-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
π Search Terms
crash createTextSpan
π Version & Regression Information
- This is a crash
β― Playground Link
No response
π» Code
https://github.com/yume-chan/ts-crash
This is a minimal repro with only 15 lines across 3 files.
π Actual behavior
pnpm i
npx tsc
Output:
# npx tsc
/root/ts-crash/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:11034
throw new Error("start < 0");
^
Error: start < 0
at createTextSpan (/root/ts-crash/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:11034:11)
at createTextSpanFromBounds (/root/ts-crash/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:11042:10)
at getErrorSpanForNode (/root/ts-crash/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:13589:10)
at createDiagnosticForNodeFromMessageChain (/root/ts-crash/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:13419:16)
at resolveExternalModule (/root/ts-crash/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:48013:31)
at resolveExternalModuleNameWorker (/root/ts-crash/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:47907:61)
at resolveExternalModuleName (/root/ts-crash/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:47904:12)
at getSymbolAtLocation (/root/ts-crash/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:84201:18)
at Object.getSymbolAtLocation (/root/ts-crash/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:45191:21)
at getReferencedFilesFromImportLiteral (/root/ts-crash/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/tsc.js:121837:28)
Node.js v21.6.2
π Expected behavior
No crash.
Additional information about the issue
Reproducible in both 5.4.5 and 5.5.0-dev.20240520
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue