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

[Build] Webpack Compilation Error is shown in some scenarios #4778

Closed
unlikelyzero opened this issue Jan 25, 2022 · 2 comments · Fixed by #4779
Closed

[Build] Webpack Compilation Error is shown in some scenarios #4778

unlikelyzero opened this issue Jan 25, 2022 · 2 comments · Fixed by #4779
Labels
type:maintenance tests, chores, or project maintenance
Milestone

Comments

@unlikelyzero
Copy link
Contributor

unlikelyzero commented Jan 25, 2022

Summary

In some scenarios, it's possible to encounter the following error when executing npm run test or npm run test:coverage.

Edit: it looks like the issue is specific to earlier versions of node 12, specifically v12.18.3

> [email protected] test /Users/jchill9/github/openmct
> cross-env NODE_OPTIONS="--max_old_space_size=4096" karma start --single-run

webpack was not included as a framework in karma configuration, setting this automatically...

karma-webpack does not currently support custom entries, if this is something you need,
consider opening an issue.
ignoring attempt to set the entry option...

Webpack bundling...
(node:72733) ExperimentalWarning: The ESM module loader is experimental.
HookWebpackError: Only file and data URLs are supported by the default ESM loader
    at makeWebpackError (/Users/jchill9/github/openmct/node_modules/webpack/lib/HookWebpackError.js:48:9)
    at /Users/jchill9/github/openmct/node_modules/webpack/lib/Compilation.js:3055:12
    at eval (eval at create (/Users/jchill9/github/openmct/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:10:1)
    at /Users/jchill9/github/openmct/node_modules/webpack/lib/Compilation.js:508:26
    at /Users/jchill9/github/openmct/node_modules/copy-webpack-plugin/dist/index.js:705:13
-- inner error --
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader
    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:727:11)
    at Loader.resolve (internal/modules/esm/loader.js:97:40)
    at Loader.getModuleJob (internal/modules/esm/loader.js:243:28)
    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:46:40)
    at link (internal/modules/esm/module_job.js:45:36)
caused by plugins in Compilation.hooks.processAssets
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader
    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:727:11)
    at Loader.resolve (internal/modules/esm/loader.js:97:40)
    at Loader.getModuleJob (internal/modules/esm/loader.js:243:28)
    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:46:40)
    at link (internal/modules/esm/module_job.js:45:36)
@unlikelyzero unlikelyzero added the type:maintenance tests, chores, or project maintenance label Jan 25, 2022
@unlikelyzero
Copy link
Contributor Author

Testing Notes

WARN thrown and build fails on: nvm install 12.18.3;nvm use 12.18.3;npm run clean;npm install
Build passes on: nvm install 12.20.2;nvm use 12.20.2;npm run clean;npm install

@shefalijoshi
Copy link
Contributor

Verified fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:maintenance tests, chores, or project maintenance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants