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

esmodule interop error on building the repo #2

Open
AdityaDonthy opened this issue Dec 20, 2021 · 2 comments
Open

esmodule interop error on building the repo #2

AdityaDonthy opened this issue Dec 20, 2021 · 2 comments

Comments

@AdityaDonthy
Copy link

AdityaDonthy commented Dec 20, 2021

I tried to build this on node 12 and 14, in both the versions I see the following error on npm run build.

> parcel build index.html lessons/**/*.html applications/**/*.html

Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/adityad/Proj-Root/rx-js-fem/rxjs-fundamentals/node_modules/weak-lru-cache/index.js
require() of ES modules is not supported.
require() of /Users/adityad/Proj-Root/rx-js-fem/rxjs-fundamentals/node_modules/weak-lru-cache/index.js from /Users/adityad/Proj-Root/rx-js-fem/rxjs-fundamentals/node_modules/lmdb-store/caching.js 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.
Instead rename index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/bsd/Proj/rx-js-fem/rxjs-fundamentals/node_modules/weak-lru-cache/package.json.
@AdityaDonthy
Copy link
Author

@stevekinney Any help is appreciated on this. I've tried both the suggestions mentioned in the error, it did not fix the issue :(

@9kartik
Copy link

9kartik commented Feb 3, 2022

@AdityaDonthy , node 14.18.2, seems to be working fine.

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

2 participants