Skip to content

Some dependency JS files appear to be erroneously typechecked #931

@LukeAbby

Description

@LukeAbby

When I built my project in TS-Go I ended up getting thousands of errors. While I'm still working through some of them to make more reports, the ones that struck me as most obviously problematic is thousands of errors in .js files in dependencies.

I decided to minimize my repo's code into something easier to investigate.

// index.ts
import "vitest/config";
import "simple-peer";

// package.json
{
  "dependencies": {
    "@types/simple-peer": "~9.11.1",
    "@typescript/native-preview": "^7.0.0-dev.20250523.1",
    "typescript": "^5.8.3",
    "vite": "^6.3.5",
    "vitest": "^3.0.5"
  }
}

// tsconfig.json
{
  "$schema": "https://json.schemastore.org/tsconfig.json",
  "compilerOptions": {
    "target": "ESNext",
    "module": "NodeNext",
    "noEmit": true,
    "noUncheckedSideEffectImports": true, // Optional
    "allowJs": true,
    "checkJs": true
  }
}

Here's that same code as a zip: dependency-js-errors.zip.

When npx tsc is run there are 0 errors, when npx tsgo is run this is the summary of the errors:

Found 321 errors in 4 files.

Errors  Files
   305  node_modules/chai/chai.js:13
     8  node_modules/vitest/dist/chunks/reporters.d.C-cu31ET.d.ts:5
     2  node_modules/vitest/dist/chunks/vite.d.iXCEVtFP.d.ts:1
     6  node_modules/vitest/dist/config.d.ts:1

My original repo experienced many more errors due to stricter tsconfig rules but I suspect that fixing these errors will fix the JS errors in my repo.

I stopped my reduction scripts once they had reduced down to minimal code in my own repo but if you'd my to help reducing the dependencies as well I'd be happy to help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: Module ResolutionRelated to module resolution and module checker errors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions