Repository: denoland/deno
Pull request: fix(check): do not surface code resolution errors in declaration file dependencies

- https://github.com/denoland/deno_graph/pull/602

Ran into this myself and was confused.

Changed files:
filename: Cargo.lock
patch: @@ -2109,9 +2109,9 @@ dependencies = [
 
 [[package]]
 name = "deno_graph"
-version = "0.98.0"
+version = "0.98.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0985b39cb178c6828c0029b11c544b9dd596e9424b4b076ad156a01cc73314ee"
+checksum = "d54ddae9ecbb3fb155a65a01d169b94a7219619b2f41de65458c4aa8c78d4123"
 dependencies = [
  "async-trait",
  "boxed_error",

filename: Cargo.toml
patch: @@ -65,7 +65,7 @@ deno_core = { version = "0.354.0" }
 deno_cache_dir = "=0.24.0"
 deno_doc = "=0.181.0"
 deno_error = "=0.7.0"
-deno_graph = { version = "=0.98.0", default-features = false }
+deno_graph = { version = "=0.98.1", default-features = false }
 deno_lint = "=0.77.0"
 deno_lockfile = "=0.31.2"
 deno_media_type = { version = "=0.2.9", features = ["module_specifier"] }

filename: cli/type_checker.rs
patch: @@ -791,20 +791,30 @@ impl<'a> GraphWalker<'a> {
               deno_graph::Resolution::Ok(resolution) => {
                 self.handle_specifier(&resolution.specifier, dep.is_dynamic);
               }
-              deno_graph::Resolution::Err(resolution_error) => {
-                if let Some(err) =
-                  resolution_error_for_tsc_diagnostic(resolution_error)
-                {
-                  self.missing_diagnostics.push(
-                    tsc::Diagnostic::from_missing_error(
-                      err.specifier,
-                      err.maybe_range,
-                      None,
-                    ),
-                  );
-                }
+              deno_graph::Resolution::Err(_) | deno_graph::Resolution::None => {
               }
-              deno_graph::Resolution::None => {}
+            }
+          }
+
+          // only surface the code error if there's no type
+          let dep_to_check_error = if dep.maybe_type.is_none() {
+            &dep.maybe_code
+          } else {
+            &dep.maybe_type
+          };
+          if let deno_graph::Resolution::Err(resolution_error) =
+            dep_to_check_error
+          {
+            if let Some(err) =
+              resolution_error_for_tsc_diagnostic(resolution_error)
+            {
+              self.missing_diagnostics.push(
+                tsc::Diagnostic::from_missing_error(
+                  err.specifier,
+                  err.maybe_range,
+                  None,
+                ),
+              );
             }
           }
         }

filename: tests/node_compat/run_all_test_unmodified.ts
patch: @@ -227,7 +227,8 @@ export async function runSingle(
     } else if (e instanceof Deno.errors.WouldBlock && retry < 3) {
       // retry 2 times on WouldBlock error (Resource temporarily unavailable)
       return runSingle(testPath, { flaky, retry: retry + 1 });
-    } else if (flaky && retry < 3) {
+    } else if (flaky && retry < 5) {
+      await new Promise((resolve) => setTimeout(resolve, 100 * retry));
       return runSingle(testPath, { flaky, retry: retry + 1 });
     } else {
       return {