-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Closed
Description
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
Reactions are currently unavailable