Home
Support Forums

My hugo build stopped working

My hugo site suddenly stopped deploying with a new error:

You can see the full build log here:
Netlify App


9:43:35 PM: ERROR 2021/11/03 02:43:35 failed to render pages: render of "page" failed: execute of template failed: template: _default/404.html:4:8: executing "_default/404.html" at <partial "head.html" .>: error calling partial: "/opt/build/repo/layouts/partials/head.html:72:9": execute of template failed: template: partials/head.html:72:9: executing "partials/head.html" at <$style.Content>: error calling Content: POSTCSS: failed to transform "css/main.css" (text/css): (node:1353) ExperimentalWarning: The ESM module loader is experimental.
9:43:35 PM: internal/modules/run_main.js:54
9:43:35 PM:     internalBinding('errors').triggerUncaughtException(
9:43:35 PM:                               ^
9:43:35 PM: Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader
9:43:35 PM:     at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:720:11)
9:43:35 PM:     at Loader.resolve (internal/modules/esm/loader.js:97:40)
9:43:35 PM:     at Loader.getModuleJob (internal/modules/esm/loader.js:243:28)
9:43:35 PM:     at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:42:40)
9:43:35 PM:     at link (internal/modules/esm/module_job.js:41:36) {
9:43:35 PM:   code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
9:43:35 PM: }

I’ve tried upgrading to the latest hugo. That doesn’t fix it. I can’t replicate the build error on my local repo.

Clearing the cache and rebuilding produces the same error.

Hi @swamidass

Unfortunately your deploy logs are private so the community at large is unable to see them, making it hard to render useful assistance.

If you can post a more substantial portion of the log here it might help others provide more timely assistance.

1 Like

Hi @swamidass,

It also helps if you can provide access to a public version of your build too, (but I understand that may not be possible to provide).

It’s exceptionally difficult to debug project specific build issues without being able to see the implementation details or test assumptions.

How do I do that? The repo is here: GitHub - PeacefulScience/hugo-website: hugo website

Just like that :slightly_smiling_face:

Now anyone passing by can take a look and see if they can spot the issue.

1 Like

So, it looks like the issue was that it was using NPM version 14, which is apparently out of date? Setting NODE_ENV to 16 seems to have solved the problem. But i’m not at all sure what caused a build problem in the first place. It had been working fine before.

What could be the issue here?

I presume you mean node version 14?

Running hugo within your package locally results in a public folder output and no errors for any of the versions of node that I tested.

v16.7.0 and v14.17.6 and even v12.20.1

I’d personally switch back to node 14 just to confirm if the error is reliably caused by that.

Yes I meant node version 14.

I switched to version 16, and the build started working.

I downgraded to version 14, and it works fine now. So now I’m stumped.

Perhaps the node installed in the cache was corrupted somehow?

At least the build is working now…

I’d suspected that might be the case, as it aligns with what I saw locally.

I’m not too sure what the actual issue was, but best of luck with it!

1 Like