Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
errors: fix ERR_UNSUPPORTED_ESM_URL_SCHEME error message
Signed-off-by: Daeyeon Jeong <daeyeon.dev@gmail.com>
  • Loading branch information
daeyeon committed Dec 9, 2022
commit 657e6609227c901eac3317a9a5c242f97553b3b3
2 changes: 1 addition & 1 deletion lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -1677,7 +1677,7 @@ E('ERR_UNKNOWN_SIGNAL', 'Unknown signal: %s', TypeError);
E('ERR_UNSUPPORTED_DIR_IMPORT', "Directory import '%s' is not supported " +
'resolving ES modules imported from %s', Error);
E('ERR_UNSUPPORTED_ESM_URL_SCHEME', (url, supported) => {
let msg = `Only URLs with a scheme in: ${ArrayPrototypeJoin(supported, ', ')} are supported by the default ESM loader`;
let msg = `Only URLs with a scheme in: ${formatList(supported)} are supported by the default ESM loader`;
if (isWindows && url.protocol.length === 2) {
msg +=
'. On Windows, absolute paths must be valid file:// URLs';
Expand Down
2 changes: 1 addition & 1 deletion test/es-module/test-esm-dynamic-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function expectFsNamespace(result) {
'ERR_UNSUPPORTED_ESM_URL_SCHEME');
if (common.isWindows) {
const msg =
'Only URLs with a scheme in: file, data are supported by the default ' +
'Only URLs with a scheme in: file and data are supported by the default ' +
'ESM loader. On Windows, absolute paths must be valid file:// URLs. ' +
"Received protocol 'c:'";
expectModuleError(import('C:\\example\\foo.mjs'),
Expand Down