-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Bug Report
π Search Terms
- verbatimModuleSyntax
π Version & Regression Information
- This is a crash using the new
verbatimModuleSyntaxoption in typescript version5.0.2
β― Playground Link
This doesn't seem code related, it seems related to the compiler options
π» Code
tsconfig.json
{
"extends": "@tsconfig/node18-strictest-esm/tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"module": "node16",
"moduleResolution": "node16",
"moduleDetection": "force",
"allowSyntheticDefaultImports": true,
"resolveJsonModule": false,
"declaration": true,
"pretty": true,
"newLine": "lf",
"removeComments": true,
"noEmitOnError": true,
"useDefineForClassFields": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"exactOptionalPropertyTypes": false,
"verbatimModuleSyntax": true,
"ignoreDeprecations": "5.0" // TODO: when node18-strictest-esm is updated for typescript 5 remove this
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
π Actual behavior
> tsc
/Projects/mysql-query/node_modules/typescript/lib/tsc.js:113959
throw e;
^
Error: Debug Failure. False expression.
at isReferencedAliasDeclaration (/Projects/mysql-query/node_modules/typescript/lib/tsc.js:80348:11)
at canConvertImportDeclarationToTypeOnly (/Projects/mysql-query/node_modules/typescript/lib/tsc.js:78887:175)
at checkImportsForTypeOnlyConversion (Projects/mysql-query/node_modules/typescript/lib/tsc.js:78902:11)
at checkSourceFileWorker (/Projects/mysql-query/node_modules/typescript/lib/tsc.js:79465:9)
at checkSourceFile (//Projects/mysql-query/node_modules/typescript/lib/tsc.js:79413:5)
at checkSourceFileWithEagerDiagnostics (/Projects/mysql-query/node_modules/typescript/lib/tsc.js:79507:5)
at getDiagnosticsWorker (/Projects/mysql-query/node_modules/typescript/lib/tsc.js:79515:7)
at Object.getDiagnostics (/ /Projects/mysql-query/node_modules/typescript/lib/tsc.js:79492:14)
at / /Projects/mysql-query/node_modules/typescript/lib/tsc.js:113984:76
at runWithCancellationToken (/Projects/mysql-query/node_modules/typescript/lib/tsc.js:113954:14)
Node.js v18.15.0`
Note that if I set "verbatimModuleSyntax": false it doesn't crash. The build runs.
π Expected behavior
A clean build or an error message about what is incompatible with setting "verbatimModuleSyntax": true.
jsaraiva, DBoroujerdi, dummdidumm, ouuan, robpalme and 7 more
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