summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/internal/bootstrap/loaders.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js
index 2889df4812..cc1157a557 100644
--- a/lib/internal/bootstrap/loaders.js
+++ b/lib/internal/bootstrap/loaders.js
@@ -186,6 +186,9 @@ function nativeModuleRequire(id) {
}
const mod = NativeModule.map.get(id);
+ // Can't load the internal errors module from here, have to use a raw error.
+ // eslint-disable-next-line no-restricted-syntax
+ if (!mod) throw new TypeError(`Missing internal module '${id}'`);
return mod.compile();
}