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

ERR_REQUIRE_ESM error #11

Closed
dougg0k opened this issue Jan 26, 2022 · 1 comment
Closed

ERR_REQUIRE_ESM error #11

dougg0k opened this issue Jan 26, 2022 · 1 comment

Comments

@dougg0k
Copy link

dougg0k commented Jan 26, 2022

Hi,

I installed the latest version, 4.0.0. I am using ts-node with ESM and it is complaining, I had it for another package which works fine, but not this one.

Error [ERR_REQUIRE_ESM]: require() of ES Module /app/node_modules/p-all/index.js from /app/src/helpers/eventsHelper.ts not supported.
Instead change the require of index.js in /app/src/helpers/eventsHelper.ts to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/app/src/helpers/eventsHelper.ts:7:33)
    at Module.m._compile (/app/node_modules/ts-node/dist/index.js:735:29)
    at Object.require.extensions.<computed> [as .ts] (/app/node_modules/ts-node/dist/index.js:737:16)
    at Object.<anonymous> (/app/src/app.ts:25:24)
    at Module.m._compile (/app/node_modules/ts-node/dist/index.js:735:29)
    at Object.require.extensions.<computed> [as .ts] (/app/node_modules/ts-node/dist/index.js:737:16)
    at Object.<anonymous> (/app/src/index.ts:6:15)
    at Module.m._compile (/app/node_modules/ts-node/dist/index.js:735:29)
    at Object.require.extensions.<computed> [as .ts] (/app/node_modules/ts-node/dist/index.js:737:16)
    at async Promise.all (index 0) {
  code: 'ERR_REQUIRE_ESM'
@dougg0k
Copy link
Author

dougg0k commented Jan 27, 2022

Forgot to add "type": "module" to package.json

@dougg0k dougg0k closed this as completed Jan 27, 2022
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