jsBuild error on Windows

Error: Error building site: JSBUILD: failed to transform “js/app.js” (application/javascript): Cannot read directory " ": Access denied

With 0.74.3, my project compiles just fine on Windows, gives that error on 0.75+.
The 2 imports in app.js.
On Netlify, it compiles just fine with 0.75.1.
Am I missing something?

The code looks okay to me. Are the packages which have to be imported in your project’s node_modules folder?

Yes they are. I’m just replacing hugo 0.74.3 executable with 0.75.1 and that error pops up.

I installed your repo locally and ran hugo server > error because of missing dependency > running npm install then hugo server > all is fine.

Try deleting node_modules and installing dependencies again. Then try deleting everything that hugo has created dynamically. If that still does not work remove the whole repo and git clone it again. I am not saying Windows is bad, but somehow it got it’s wires crossed about file rights here.

(Olen oppinut Finishin kerran, mutta unohdin kaiken siitä :smiley: bad google translate ;])

Did not help. Fresh clone, npm install and still 0.75.1 gives that error. 0.74.3 works like a charm.

That might be worth a bug report on GitHub.

I’m guessing a bug introduced upstream in ESBuild. I quickly browsed the change set, but the maintainer in that repo is pretty … quick so a lots of stuff is happening there.

Finally got around to testing esbuild itself…
The error came from package.json which had main: " ".
Removing that line fixed my error.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.