-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
modules esmodules
🕗 Version & Regression Information
v4.8.2
- This is a crash
I am converting some old code from module=none to module=es2015.
After changing the code and tsconfig I get
in folder: C:\tfs\TwinCAT-HMI\TcHmiFramework ...C:\tfs\TwinCAT-HMI\TcHmiFramework\node_modules\typescript\lib\tsc.js:16219
return option.strictFlag ? getStrictOptionValue(options, option.name) : options[option.name];
^
TypeError: Cannot read properties of undefined (reading 'outFile')
at getCompilerOptionValue (C:\tfs\TwinCAT-HMI\TcHmiFramework\node_modules\typescript\lib\tsc.js:16219:88)
at C:\tfs\TwinCAT-HMI\TcHmiFramework\node_modules\typescript\lib\tsc.js:10977:33
at Array.some (<anonymous>)
at optionsHaveChanges (C:\tfs\TwinCAT-HMI\TcHmiFramework\node_modules\typescript\lib\tsc.js:10976:64)
at Object.compilerOptionsAffectDeclarationPath (C:\tfs\TwinCAT-HMI\TcHmiFramework\node_modules\typescript\lib\tsc.js:16214:16)
at createBuilderProgramState (C:\tfs\TwinCAT-HMI\TcHmiFramework\node_modules\typescript\lib\tsc.js:100565:17)
at Object.createBuilderProgram (C:\tfs\TwinCAT-HMI\TcHmiFramework\node_modules\typescript\lib\tsc.js:101181:21)
at createEmitAndSemanticDiagnosticsBuilderProgram (C:\tfs\TwinCAT-HMI\TcHmiFramework\node_modules\typescript\lib\tsc.js:101554:19)
at Object.host.createProgram (C:\tfs\TwinCAT-HMI\TcHmiFramework\node_modules\typescript\lib\tsc.js:106634:20)
at createProgram (C:\tfs\TwinCAT-HMI\TcHmiFramework\node_modules\typescript\lib\tsc.js:104850:28)
TypeScript/src/compiler/utilities.ts
Line 6496 in 16156b1
| return option.strictFlag ? getStrictOptionValue(options, option.name as StrictOptionName) : options[option.name]; |
Added some debug output in this js file:
option: {
name: 'outFile',
type: 'string',
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
affectsDeclarationPath: true,
affectsBundleEmitBuildInfo: true,
isFilePath: true,
paramType: {
code: 6035,
category: 3,
key: 'FILE_6035',
message: 'FILE',
reportsUnnecessary: undefined,
elidedInCompatabilityPyramid: undefined,
reportsDeprecated: undefined
},
showInSimplifiedHelpView: true,
category: {
code: 6246,
category: 3,
key: 'Emit_6246',
message: 'Emit',
reportsUnnecessary: undefined,
elidedInCompatabilityPyramid: undefined,
reportsDeprecated: undefined
},
description: {
code: 6679,
category: 3,
key: 'Specify_a_file_that_bundles_all_outputs_into_one_JavaScript_file_If_declaration_is_true_also_designa_6679',
message: "Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output.",
reportsUnnecessary: undefined,
elidedInCompatabilityPyramid: undefined,
reportsDeprecated: undefined
},
transpileOptionValue: undefined
}
options: undefined
Changed the line to
return option.strictFlag ? getStrictOptionValue(options, option.name) : options?.[option.name];
and got a working compile.
After that the unchanged typescript compiler works again. So I suspect a problem with an old tsconfig.tsbuildinfo.
Reactions are currently unavailable
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