question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ERR_REQUIRE_ESM error

See original GitHub issue

My webpack config is an esmodule, so because eslint-plugin-import-webpack is using require(), I get:

Resolve error: Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: ./webpack.config.js require() of ES modules is not supported.

And things fail.

Any way you can support ESM webpack config files?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ljharbcommented, May 8, 2022

@kemaakpala no. Stick to CJS (or transpiled ESM) for many reasons, including this issue.

0reactions
kemaakpalacommented, May 8, 2022

@ljharb is there anyway to get arround this, apart from having to revert my webpack config files.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error [ERR_REQUIRE_ESM]: require() of ES Module not ...
The error [ERR_REQUIRE_ESM]: require() of ES Module not supported. Instead change the require of index.js to a dynamic import() which is available in...
Read more >
Error [ERR_REQUIRE_ESM]: How to use es6 modules in ...
You have to add this line of code in your package.json file "type" : "module" You will be able to use imports statements...
Read more >
ERR_REQUIRE_ESM - DEV Community ‍ ‍
Once you update you package deps you may face with the error mentioned in this note title: Error [ERR_REQUIRE_ESM]: Must use import to...
Read more >
Error ERR REQUIRE ESM | Must use import to load ES Module
Error ERR REQUIRE ESM | Must use import to load ES Module. 15,379 views15K views. Apr 2, 2021. 46. Dislike. Share. Save.
Read more >
Error [ERR_REQUIRE_ESM]: Must use import to load ES ...
tools'; ^ Error [ERR_REQUIRE_ESM]: require() of ES Module ... changes to project to became full ESM, or accept the security issue :( ) ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found