mirror of
https://github.com/denoland/deno.git
synced 2024-12-21 23:04:45 -05:00
fix(cli/graph_util): don't append referrer info for root module errors (#17730)
This commit is contained in:
parent
a55f0eb2fc
commit
13493d9121
4 changed files with 5 additions and 4 deletions
|
@ -57,6 +57,10 @@ pub fn graph_valid(
|
|||
walk_options: deno_graph::WalkOptions,
|
||||
) -> Result<(), AnyError> {
|
||||
graph.walk(roots, walk_options).validate().map_err(|error| {
|
||||
let is_root = match &error {
|
||||
ModuleGraphError::ResolutionError(_) => false,
|
||||
_ => roots.contains(error.specifier()),
|
||||
};
|
||||
let mut message = if let ModuleGraphError::ResolutionError(err) = &error {
|
||||
enhanced_resolution_error_message(err)
|
||||
} else {
|
||||
|
@ -64,7 +68,7 @@ pub fn graph_valid(
|
|||
};
|
||||
|
||||
if let Some(range) = error.maybe_range() {
|
||||
if !range.specifier.as_str().contains("/$deno$eval") {
|
||||
if !is_root && !range.specifier.as_str().contains("/$deno$eval") {
|
||||
message.push_str(&format!("\n at {range}"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
error: Uncaught (in promise) TypeError: Module not found "[WILDCARD]/bad-module.ts".
|
||||
at file:///[WILDCARD]/error_005_missing_dynamic_import.ts:2:35
|
||||
const _badModule = await import("./bad-module.ts");
|
||||
^
|
||||
at async file://[WILDCARD]/error_005_missing_dynamic_import.ts:2:22
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
error: Uncaught (in promise) TypeError: Requires net access to "localhost:4545", run again with the --allow-net flag
|
||||
at file:///[WILDCARD]/error_015_dynamic_import_permissions.js:2:16
|
||||
await import("http://localhost:4545/subdir/mod4.js");
|
||||
^
|
||||
at async file://[WILDCARD]/error_015_dynamic_import_permissions.js:2:3
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
error: Uncaught (in worker "") (in promise) TypeError: Requires net access to "example.com", run again with the --allow-net flag
|
||||
at http://localhost:4545/workers/dynamic_remote.ts:2:14
|
||||
await import("https://example.com/some/file.ts");
|
||||
^
|
||||
at async http://localhost:4545/workers/dynamic_remote.ts:2:1
|
||||
|
|
Loading…
Reference in a new issue