diff --git a/ext/node/resolution.rs b/ext/node/resolution.rs index c94b55f542..84d8ba39dd 100644 --- a/ext/node/resolution.rs +++ b/ext/node/resolution.rs @@ -878,15 +878,15 @@ impl NodeResolver { last_error = None; continue; } - Err(e) => match e.as_kind() { - PackageTargetResolveErrorKind::InvalidPackageTarget(_) => { + Err(e) => { + // todo(dsherret): add codes to each error and match on that instead + if e.to_string().starts_with("[ERR_INVALID_PACKAGE_TARGET]") { last_error = Some(e); continue; - } - _ => { + } else { return Err(e); } - }, + } } } if last_error.is_none() {