Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Must use import to load ES Module #73

Open
hazcod opened this issue Dec 28, 2021 · 1 comment
Open

Must use import to load ES Module #73

hazcod opened this issue Dec 28, 2021 · 1 comment

Comments

@hazcod
Copy link

hazcod commented Dec 28, 2021

Hi!
I updated dept for your status page to fix a myriad of security vulnerabilities and trying to deploy via CD here: https://github.com/iron-security/status/runs/4650294217?check_suite_focus=true#step:7:174

However, this results in the following error:

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /github/workspace/node_modules/node-fetch/src/index.js
175
require() of ES modules is not supported.
176
require() of /github/workspace/node_modules/node-fetch/src/index.js from /github/workspace/src/cli/gcMonitors.cjs is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
177
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /github/workspace/node_modules/node-fetch/package.json.
178

179
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1015:13)
180
    at Module.load (internal/modules/cjs/loader.js:863:32)
181
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
182
    at Module.require (internal/modules/cjs/loader.js:887:19)
183
    at require (internal/modules/cjs/helpers.js:74:18)
184
    at Object.<anonymous> (/github/workspace/src/cli/gcMonitors.cjs:2:15)
185
    at Module._compile (internal/modules/cjs/loader.js:999:30)
186
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
187
    at Module.load (internal/modules/cjs/loader.js:863:32)
188
    at Function.Module._load (internal/modules/cjs/loader.js:708:14) {
189
  code: 'ERR_REQUIRE_ESM'
190
}

Any idea how best to fix here? Thank you!

@hazcod
Copy link
Author

hazcod commented Mar 10, 2022

Any idea here @eidam ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant