Skip to content

declarationMap causing incremental builds to crash on version 4+ #44335

Closed
@moshest

Description

@moshest

Bug Report

I'm getting a crash every time I change a .ts file.

This happen where .tsbuildinfo exists and declarationMap is set on true. Looks like the compiler don't expect to see a .d.ts.map before .d.ts file and throwing an error.

🔎 Search Terms

Debug Failure. False expression: File extension for signature expected to be dts

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions 3.7.7 and 4.3.2

The crash will NOT happen if I disable declarationMap.

Deleting .tsbuildinfo will solve the problem until the next change (ie. build only the current version).

💻 Code

Prblematic .tsbuildinfo file: https://pastebin.com/rtCNGBmr

tsconfig settings:

{
  "compilerOptions": {
    "target": "es2020",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "module": "es2020",
    "composite": true,
    "resolveJsonModule": true,
    "declaration": true,
    "strict": true,
    "allowSyntheticDefaultImports": true,
    "esModuleInterop": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "moduleResolution": "node",
    "isolatedModules": true,
    "jsx": "react",
    "declarationMap": true,
    "noImplicitReturns": true,
    "pretty": true,
    "sourceMap": true,
    "inlineSources": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictBindCallApply": true,
    "strictFunctionTypes": true,
    "strictPropertyInitialization": true,
    "noImplicitThis": true,
    "noEmit": false,
   "baseUrl": "src",
    "rootDir": "src",
    "outDir": "lib",
    "paths": {
      "@/*": ["./*"]
    }
  },
  "include": ["src"],
  "exclude": ["node_modules"]
}

🙁 Actual behavior

Crashing with the following error:

/Users/moshe/git/anytrack/anytrack-services/node_modules/typescript/lib/typescript.js:2479
            throw e;
            ^

Error: Debug Failure. False expression: File extension for signature expected to be dts
Verbose Debug Information: Found: .map for /.../packages/config/lib/index.d.ts.map:: All output files: ["/.../packages/config/lib/index.d.ts.map","/.../packages/config/lib/index.d.ts"]
    at updateShapeSignature (/.../node_modules/typescript/lib/typescript.js:112516:30)
    at Object.getFilesAffectedBy (/.../node_modules/typescript/lib/typescript.js:112470:18)
    at getNextAffectedFile (/.../node_modules/typescript/lib/typescript.js:112943:51)
    at getSemanticDiagnosticsOfNextAffectedFile (/.../node_modules/typescript/lib/typescript.js:113567:32)
    at Object.getSemanticDiagnostics (/.../node_modules/typescript/lib/typescript.js:113612:20)
    at getSemanticDiagnostics (/.../node_modules/typescript/lib/typescript.js:116910:62)
    at executeSteps (/.../node_modules/typescript/lib/typescript.js:117051:25)
    at Object.done (/.../node_modules/typescript/lib/typescript.js:116856:13)
    at build (/.../node_modules/typescript/lib/typescript.js:117523:32)
    at Object.build (/.../node_modules/typescript/lib/typescript.js:117705:101)

🙂 Expected behavior

Build project without any crash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions