Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9159649

Browse filesBrowse files
Trottcodebytere
authored andcommitted
esm: shorten ERR_UNSUPPORTED_ESM_URL_SCHEME message
I know it just got modified to include new information, but this shortens the message a bit without (I hope) losing clarity or meaning. PR-URL: #34836 Backport-PR-URL: #35385 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
1 parent 551be2a commit 9159649
Copy full SHA for 9159649

File tree

Expand file treeCollapse file tree

2 files changed

+4
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+4
-4
lines changed
Open diff view settings
Collapse file

‎lib/internal/errors.js‎

Copy file name to clipboardExpand all lines: lib/internal/errors.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,8 +1404,8 @@ E('ERR_UNSUPPORTED_DIR_IMPORT', "Directory import '%s' is not supported " +
14041404
E('ERR_UNSUPPORTED_ESM_URL_SCHEME', (url) => {
14051405
let msg = 'Only file and data URLs are supported by the default ESM loader';
14061406
if (isWindows && url.protocol.length === 2) {
1407-
msg += '. Absolute Windows paths without prefix are not valid URLs, ' +
1408-
"consider using 'file://' prefix";
1407+
msg +=
1408+
'. On Windows, absolute paths must be valid file:// URLs';
14091409
}
14101410
msg += `. Received protocol '${url.protocol}'`;
14111411
return msg;
Collapse file

‎test/es-module/test-esm-dynamic-import.js‎

Copy file name to clipboardExpand all lines: test/es-module/test-esm-dynamic-import.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ function expectFsNamespace(result) {
6262
if (common.isWindows) {
6363
const msg =
6464
'Only file and data URLs are supported by the default ESM loader. ' +
65-
'Absolute Windows paths without prefix are not valid URLs, ' +
66-
"consider using 'file://' prefix. Received protocol 'c:'";
65+
'On Windows, absolute paths must be valid file:// URLs. ' +
66+
"Received protocol 'c:'";
6767
expectModuleError(import('C:\\example\\foo.mjs'),
6868
'ERR_UNSUPPORTED_ESM_URL_SCHEME',
6969
msg);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.