-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: #4625
Comments
I have this bug on mocha@9.1.3 (node v16.13.1):
Doesn't it mean that Mocha tries to load the module with require()? |
@pr0t4zy Probably yes, In case you are using Mocha programmatically, you have to load your test files in an asynchronous way with |
I changed:
to
And works like a charm. Thank you for the support! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
faq
labelnode node_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend that you not install Mocha globally.Description
Steps to Reproduce
run
mocha <test_folder>
Expected behavior: [What you expect to happen]
No error
Actual behavior: [What actually happens]
Reproduces how often: [What percentage of the time does it reproduce?]
Versions
5.2.0
mocha --version
andnode node_modules/.bin/mocha --version
: 5.2.0node --version
:node:latest
Additional Information
The text was updated successfully, but these errors were encountered: