Build fails after no changes in code

Hello! Could you please help me with failing build? I have the error:

Jun 8 11:17:47 AM ==> Downloading cache…
Jun 8 11:17:50 AM ==> Detected Node version 12.16.1
Jun 8 11:17:50 AM internal/modules/cjs/loader.js:1174
Jun 8 11:17:50 AM throw new ERR_REQUIRE_ESM(filename, parentPath, packageJsonPath);
Jun 8 11:17:50 AM ^
Jun 8 11:17:50 AM
Jun 8 11:17:50 AM Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /usr/lib/node_modules/@renderinc/fetch-node-version/index.js
Jun 8 11:17:50 AM at Object.Module._extensions…js (internal/modules/cjs/loader.js:1174:13)
Jun 8 11:17:50 AM at Module.load (internal/modules/cjs/loader.js:1002:32)
Jun 8 11:17:50 AM at Function.Module._load (internal/modules/cjs/loader.js:901:14)
Jun 8 11:17:50 AM at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
Jun 8 11:17:50 AM at internal/main/run_main_module.js:18:47 {
Jun 8 11:17:50 AM code: ‘ERR_REQUIRE_ESM’
Jun 8 11:17:50 AM }

But I did not change anything in code since yesterday. And yesterday it was ok, build was live. Is this problem on my side? Locally it builds without problems.

Hi @demetrius,

Thanks for reporting! We’re looking into it.

1 Like

Hey @demetrius , Could you try clearing the build cache and building again?

1 Like

I did it, it does not help. I set up Node version (14) in the env variable and this helped in my case. It seems that during today crisis Node version on Render was downgraded from LTS (14) to 12.

Hi @demetrius ,

We’ve identified the issue and are working on a fix. You can subscribe to updates on this page: Render Status - Static sites using NodeJS versions < 12.20.0 are failing to build and deploy .

We were about to suggest this workaround, but yes, you can upgrade your NodeJS version to 12.20 or higher, and your static site should build successfully.

1 Like

Thank you very much!