| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
test/es-module/test-esm-dynamic-import.js // TODO(jkrems): Right now this doesn't hit a protocol error because the
// module resolution step already rejects it. These arguably should be
// protocol errors.
expectMissingModuleError(import('node:fs'));
expectMissingModuleError(import('http://example.com/foo.js'));This is the only test failing right now. The problem is that the loader converts the url to a file url and ignores the url scheme, producing a misleading error message (and it may probably load a wrong module). Should we update this test to check for ERR_UNSUPPORTED_ESM_URL_SCHEME, or should we delete this new error type and stick with the generic ERR_MODULE_NOT_FOUND? |
Sorry, something went wrong.
There was a problem hiding this comment.
you can use parsed.scheme a few lines down.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for the PR, the approach looks great.
The test failures can be fixed by just changing the test expectations in https://github.com/nodejs/node/blob/master/test/es-module/test-esm-dynamic-import.js#L60. Note that the errors exactly align with a TODO comment @jkrems included previously.
Sorry, something went wrong.
The default ESM loader supports only file and data URLs. This PR adds better error message for it.
Sorry, something went wrong.
|
This is stalled on two issues in CI (nodejs/build#2116 and nodejs/build#2115) that will hopefully be resolved soon. |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
The default ESM loader supports only file and data URLs. This PR adds better error message for it. PR-URL: nodejs#31129 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
The default ESM loader supports only file and data URLs. This PR adds better error message for it. PR-URL: #31129 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
The default ESM loader supports only file and data URLs. This PR adds better error message for it. PR-URL: #31129 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
The default ESM loader supports only file and data URLs. This PR adds better error message for it. PR-URL: #31129 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
| Back | FazBrowse Home | New Git URL |
The default ESM loader supports only file and data URLs.
This PR adds better error message for it.
Fixes #31120
Checklist