We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf7b796 commit 89a58f6Copy full SHA for 89a58f6
1 file changed
lib/internal/modules/cjs/loader.js
@@ -54,7 +54,7 @@ const {
54
maybeCacheSourceMap,
55
rekeySourceMap
56
} = require('internal/source_map/source_map_cache');
57
-const { pathToFileURL, fileURLToPath, URL } = require('internal/url');
+const { pathToFileURL, fileURLToPath, isURLInstance } = require('internal/url');
58
const { deprecate } = require('internal/util');
59
const vm = require('vm');
60
const assert = require('internal/assert');
@@ -1089,7 +1089,7 @@ const createRequireError = 'must be a file URL object, file URL string, or ' +
1089
function createRequire(filename) {
1090
let filepath;
1091
1092
- if (filename instanceof URL ||
+ if (isURLInstance(filename) ||
1093
(typeof filename === 'string' && !path.isAbsolute(filename))) {
1094
try {
1095
filepath = fileURLToPath(filename);
0 commit comments