Skip to content

Crash encountered #41

@bradzacher

Description

@bradzacher

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions