summaryrefslogtreecommitdiff
path: root/ext/node/errors.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-11-04 12:41:51 -0400
committerGitHub <noreply@github.com>2023-11-04 16:41:51 +0000
commite4c947dd2b63726ecc9b4303e03921b6839adade (patch)
tree9619bdb6649d1f460fb02ab8e448c27c95dbfa74 /ext/node/errors.rs
parent0b75a7169b2e123cac04e7ffcaf16a28eb356fd0 (diff)
fix(node): use closest package.json to resolve package.json imports (#21075)
Diffstat (limited to 'ext/node/errors.rs')
-rw-r--r--ext/node/errors.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/node/errors.rs b/ext/node/errors.rs
index e72cb8557..e07a8347a 100644
--- a/ext/node/errors.rs
+++ b/ext/node/errors.rs
@@ -138,11 +138,12 @@ pub fn err_package_import_not_defined(
base: &str,
) -> AnyError {
let mut msg = format!(
- "[ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier \"{specifier}\" is not defined in"
+ "[ERR_PACKAGE_IMPORT_NOT_DEFINED] Package import specifier \"{specifier}\" is not defined"
);
if let Some(package_path) = package_path {
- msg = format!("{msg} in package {package_path}package.json");
+ let pkg_json_path = PathBuf::from(package_path).join("package.json");
+ msg = format!("{} in package {}", msg, pkg_json_path.display());
}
msg = format!("{msg} imported from {base}");