-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module #1062
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
Comments
See #601 |
@aleclarson So how to fix this on v8? 601 seems to be for v9. I'm on nodejs v14.10.0. this is my loader setup nodejs:
|
When I am using
and when I switch to cjs I start getting
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐛 Bug Report
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: \node_modules@babel\runtime\helpers\esm\objectWithoutPropertiesLoose.js
require() of ES modules is not supported.
require() of \node_modules@babel\runtime\helpers\esm\objectWithoutPropertiesLoose.js from \node_modules\react-spring\renderprops.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 objectWithoutPropertiesLoose.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from \node_modules@babel\run
time\helpers\esm\package.json.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
not throwing an error
Link to repro (highly encouraged)
(Please provide either a CodeSandbox demo or an example GitHub repo.)
Environment
nodejs
v12.16.1react-spring
^8.0.27react
^16.13.1The text was updated successfully, but these errors were encountered: