Skip to content

Commit 985ec48

Browse files
legendecastargos
authored andcommitted
src: print native module id on native module not found
To help core contributors identify which file is missing from the build. PR-URL: #39460 Refs: #39408 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 83f5cc0 commit 985ec48

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/node_native_module.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,10 @@ MaybeLocal<String> NativeModuleLoader::LoadBuiltinModuleSource(Isolate* isolate,
222222
isolate, contents.c_str(), v8::NewStringType::kNormal, contents.length());
223223
#else
224224
const auto source_it = source_.find(id);
225-
CHECK_NE(source_it, source_.end());
225+
if (UNLIKELY(source_it == source_.end())) {
226+
fprintf(stderr, "Cannot find native builtin: \"%s\".\n", id);
227+
ABORT();
228+
}
226229
return source_it->second.ToStringChecked(isolate);
227230
#endif // NODE_BUILTIN_MODULES_PATH
228231
}

0 commit comments

Comments
 (0)