Skip to content

Commit f7429fa

Browse files
committed
fixup! esm: fix misleading error when import empty package.json
1 parent f23c1e4 commit f7429fa

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/node_file.cc

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3431,12 +3431,11 @@ void BindingData::LegacyMainResolve(const FunctionCallbackInfo<Value>& args) {
34313431
return;
34323432
}
34333433

3434-
// todo(himself65): `"Cannot find entry file for module " + module_path + " in " + module_base;`
3435-
34363434
THROW_ERR_MODULE_NOT_FOUND(isolate,
3437-
"Cannot find package '%s' imported from %s",
3438-
package_initial_file,
3439-
*module_base);
3435+
"No package entry point defined for package '%s' imported from %s",
3436+
package_json_url.value(),
3437+
*module_base
3438+
);
34403439
}
34413440

34423441
void BindingData::MemoryInfo(MemoryTracker* tracker) const {

0 commit comments

Comments
 (0)