summaryrefslogtreecommitdiff
path: root/cli/graph_util.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/graph_util.rs')
-rw-r--r--cli/graph_util.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/cli/graph_util.rs b/cli/graph_util.rs
index d98d3cfd0..6136c5691 100644
--- a/cli/graph_util.rs
+++ b/cli/graph_util.rs
@@ -22,6 +22,7 @@ use deno_core::ModuleSpecifier;
use deno_core::TaskQueue;
use deno_core::TaskQueuePermit;
use deno_graph::Module;
+use deno_graph::ModuleError;
use deno_graph::ModuleGraph;
use deno_graph::ModuleGraphError;
use deno_graph::ResolutionError;
@@ -83,7 +84,9 @@ pub fn graph_valid(
.flat_map(|error| {
let is_root = match &error {
ModuleGraphError::ResolutionError(_) => false,
- _ => roots.contains(error.specifier()),
+ ModuleGraphError::ModuleError(error) => {
+ roots.contains(error.specifier())
+ }
};
let mut message = if let ModuleGraphError::ResolutionError(err) = &error {
enhanced_resolution_error_message(err)
@@ -99,7 +102,10 @@ pub fn graph_valid(
if options.is_vendoring {
// warn about failing dynamic imports when vendoring, but don't fail completely
- if matches!(error, ModuleGraphError::MissingDynamic(_, _)) {
+ if matches!(
+ error,
+ ModuleGraphError::ModuleError(ModuleError::MissingDynamic(_, _))
+ ) {
log::warn!("Ignoring: {:#}", message);
return None;
}
@@ -436,7 +442,6 @@ mod test {
specifier: input.to_string(),
range: Range {
specifier,
- text: "".to_string(),
start: Position::zeroed(),
end: Position::zeroed(),
},
@@ -453,7 +458,6 @@ mod test {
let err = ResolutionError::InvalidSpecifier {
range: Range {
specifier,
- text: "".to_string(),
start: Position::zeroed(),
end: Position::zeroed(),
},