microsoft / microsoft/ts-fix

Crash encountered

Open
#41 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
232
Forks
18
PR merge metrics
No merged PRs in 30d

Description

I tried running ts-fix over our massive codebase at Canva in an attempt to auto-fix the isolatedDeclaration errors as a test. It took quite a while -- well over 12 hours and I left it running over night.

In the morning I checked my laptop and found it had crashed:

node /Users/bjz/git/ts-fix/dist/cli.js --write -e 9010 -e 9016 -e 9015 -e 9008 -e 9007 --ignoreGitStatus --tsconfig tsconfig.build.json
The project is being created...

Using TypeScript 5.5.4

Found 15365 diagnostics with code 9010

Found 4911 diagnostics with code 9016

Found 437 diagnostics with code 9015

Found 34138 diagnostics with code 9008

Found 23554 diagnostics with code 9007
/Users/bjz/work/canva/node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/typescript.js:177120
          Debug.assert(tokenInfo.token.end === child.end, "Token end is child end");
                ^

Error: Debug Failure. False expression: Token end is child end
    at processChildNode (/Users/bjz/work/canva/node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/typescript.js:177120:17)
    at /Users/bjz/work/canva/node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/typescript.js:177051:9
    at visitNode2 (/Users/bjz/work/canva/node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/typescript.js:31743:18)
    at forEachChildInJsxAttribute (/Users/bjz/work/canva/node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/typescript.js:32121:45)
    at forEachChild (/Users/bjz/work/canva/node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/typescript.js:32264:35)
    at processNode (/Users/bjz/work/canva/node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/typescript.js:177048:5)
    at processChildNode (/Users/bjz/work/canva/node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/typescript.js:177127:7)
    at processChildNodes (/Users/bjz/work/canva/node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/typescript.js:177170:32)
    at /Users/bjz/work/canva/node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/typescript.js:177064:9
    at visitNodes (/Users/bjz/work/canva/node_modules/.pnpm/typescript@5.5.4/node_modules/typescript/lib/typescript.js:31748:14)

Node.js v20.18.0

I don't know what caused it because there was no information dumped out -- i.e. no filename, no line number, nothing :(

Request:
Add error handling to catch the errors to aid with debugging.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the command shown against the Canva codebase, using dist/cli.js and tsconfig.build.json as the entry points. Trace the TypeScript 5.5.4 failure during processing and add handling that reports the relevant filename and line number; done means the crash provides debugging context instead of only the assertion stack.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.