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]: require() of ES Module when using ES loader #15930

Closed
wclr opened this issue Jun 8, 2022 · 6 comments · Fixed by #15198
Closed

[ERR_REQUIRE_ESM]: require() of ES Module when using ES loader #15930

wclr opened this issue Jun 8, 2022 · 6 comments · Fixed by #15198

Comments

@wclr
Copy link

wclr commented Jun 8, 2022

Bug report

Trying to use a ESM module as a loader, simple repro:

https://github.com/wclr/webpack-esm-loader-issue

What is the current behavior?

Module build failed (from ./loader.js):
Error [ERR_REQUIRE_ESM]: require() of ES Module ..\webpack-esm-loader-issue\loader.js from D:\Code\webpack-esm-loader-issue\node_modules\loader-runner\lib\loadLoader.js not supported.
Instead change the require of loader.js in ..\webpack-esm-loader-issue\node_modules\loader-runner\lib\loadLoader.js to a dynamic import() which is available in all CommonJS modules.

Other relevant information:
webpack version: 5.73.0
Node.js version: 16
Operating System: Windows 10

@jramstedt

This comment was marked as off-topic.

@vankop
Copy link
Member

vankop commented Jun 8, 2022

should be fixed by #15198

@webpack-bot
Copy link
Contributor

This issue had no activity for at least three months.

It's subject to automatic issue closing if there is no activity in the next 15 days.

@alexander-akait
Copy link
Member

bump

@webpack-bot
Copy link
Contributor

Issue was closed because of inactivity.

If you think this is still a valid issue, please file a new issue with additional information.

@alexander-akait
Copy link
Member

Close in favor #13233, we will ship it in the next release, sorry for delay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants