After getting the most recent upgrade, am encountering this error:
ERROR JSBUILD: failed to transform "/js/main.js" (text/javascript): Could not resolve "@cloudinary/url-gen" Built in 1557 ms Error: error building site: JSBUILD: failed to transform "/js/main.js" (text/javascript): Could not resolve "@cloudinary/url-gen"
So in my triaging this issue, if I disable the offending node_module, (@cloudinary/url-gen), Hugo will continue to build etc. So it seems like a matter of the module not being found, but therein lies the rub, as it were. If I nuke the entire node_modules
folder and then run npm i
again; no joy. I thought maybe it had something to do w/ the cloudinary module, so I tried a different module from npm just to see, and got the same build error.
I should add this was working on the previous version of Hugo. If I write JS with no module imports from the node_modules
the project will build and everything works as expected…
So it seems that for some reason js.Build is not able to find the node modules directory. See below for my file structure:
├─ archetypes
├─ content
├─ data
├─ layouts
├─ node_modules
├─ @cloudinary
├── public
├── resources
├── sandbox
├── static
└── themes
└─ blank
├─ archetypes
├─ assets
├── js
│
utils.js
mobileNav.js
├─ ...
Node Version: 16.14.2
hugo v0.128.0+extended darwin/amd64 BuildDate=2024-06-25T16:15:48Z VendorInfo=brew
Not sure where to go from here, perhaps a config file is order, to explicitly direct js.Build to node modules?
Thanks