Skip to content

Commit 8a96182

Browse files
cjihrigtargos
authored andcommitted
module: add missing space in error message
PR-URL: #27627 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Yongsheng Zhang <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 169ddc5 commit 8a96182

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/internal/modules/cjs/loader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ function createRequireFromPath(filename) {
853853

854854
Module.createRequireFromPath = createRequireFromPath;
855855

856-
const createRequireError = 'must be a file URL object, file URL string, or' +
856+
const createRequireError = 'must be a file URL object, file URL string, or ' +
857857
'absolute path string';
858858

859859
function createRequire(filename) {

test/parallel/test-module-create-require.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,7 @@ assert.throws(() => {
3030
assert.throws(() => {
3131
createRequire({});
3232
}, {
33-
code: 'ERR_INVALID_ARG_VALUE'
33+
code: 'ERR_INVALID_ARG_VALUE',
34+
message: 'The argument \'filename\' must be a file URL object, file URL ' +
35+
'string, or absolute path string. Received {}'
3436
});

0 commit comments

Comments
 (0)