Closed rhhill1401 closed 3 months ago
We'll definitely need the code that causes this crash. Can you share a repro? Thanks!
It seems I face the same/a similar problem with TypeScript 5.0.4
:
/Users/manuel/git/insidelabs/omni-app/node_modules/typescript/lib/tsc.js:53470
if (type.flags & 524288 /* Object */) {
^
TypeError: Cannot read properties of undefined (reading 'flags')
at getPropertyOfObjectType (/Users/manuel/git/insidelabs/omni-app/node_modules/typescript/lib/tsc.js:53470:14)
at getPropertyOfType (/Users/manuel/git/insidelabs/omni-app/node_modules/typescript/lib/tsc.js:54068:14)
at checkPropertyAccessExpressionOrQualifiedName (/Users/manuel/git/insidelabs/omni-app/node_modules/typescript/lib/tsc.js:68600:14)
at checkPropertyAccessExpression (/Users/manuel/git/insidelabs/omni-app/node_modules/typescript/lib/tsc.js:68425:94)
at checkExpressionWorker (/Users/manuel/git/insidelabs/omni-app/node_modules/typescript/lib/tsc.js:73954:16)
at checkExpression (/Users/manuel/git/insidelabs/omni-app/node_modules/typescript/lib/tsc.js:73874:32)
at checkExpressionCached (/Users/manuel/git/insidelabs/omni-app/node_modules/typescript/lib/tsc.js:73543:28)
at getTargetOfAliasLikeExpression (/Users/manuel/git/insidelabs/omni-app/node_modules/typescript/lib/tsc.js:45377:5)
at getTargetOfExportAssignment (/Users/manuel/git/insidelabs/omni-app/node_modules/typescript/lib/tsc.js:45349:22)
at getTargetOfAliasDeclaration (/Users/manuel/git/insidelabs/omni-app/node_modules/typescript/lib/tsc.js:45404:16)
Node.js v20.18.0
I already tried upgrading to the latest stable and next
versions of TypeScript; no improvement.
I would love to provide a repro for this. However, I face this situation during a major upgrade of a dependency of our code base and I have no idea where to start looking for the root cause. I tried passing --traceResolution
and --extendedDiagnostics
to tsc
already, but somehow I am not sure if, e.g., the last resolved module is really a place to start at. How would you suggest I should get started @RyanCavanaugh?
Thanks already! 🙏
Alright, I was able to identify the problem in our code base: We had a rouge .d.ts
file flying around from 5 years ago nobody was thinking of anymore:
declare module 'console' {
export = typeof import('console');
}
By removing this type declaration file, tsc
runs smooth again.
I do not understand why the definitions in that file crash tsc
(yet). However, I want to share the steps used which lead me to the cause:
tsc
with enabled debugging: node ./node_modules/typescript/lib/tsc --inspect-brk
.chrome://inspect
, and connect to the waiting Node.js instance.tsc.js
in the source tab, go to line 53470
based on the stack trace shared before and add a breakpoint.type
function parameter. No results.initializeTypeChecker
function.mergeSymbolTable
). Log the file
variable. Hypothesis behind this log point: This should log the TypeScript source file which crashes tsc
.tsc
with --inspect-brk
and re-run the debugger..d.ts
mentioned above:
If we cant identify the underlying problem in the TypeScript compiler, maybe the analysis steps help at least other people having the same issue :)
@swissmanu very good investigation. Do you have the rest of the code that triggers the crash? Putting that into a project, I'm not seeing any errors
Type: Bug
❗️❗️❗️ Please fill in the sections below to help us diagnose the issue ❗️❗️❗️
TypeScript Version: 5.4.0-dev.20231210
Steps to reproduce crash
1. 2. 3.
TS Server Log
❗️ Server logging disabled. To help us fix crashes like this, please enable logging by setting:
After enabling this setting, future crash reports will include the server log.
TS Server Error Stack
Server:
semantic
VS Code version: Code 1.85.0 (Universal) (af28b32d7e553898b2a91af498b1fb666fdebe0c, 2023-12-06T18:18:04.614Z) OS version: Darwin arm64 22.3.0 Modes:
System Info
|Item|Value| |---|---| |CPUs|Apple M1 Max (10 x 24)| |GPU Status|2d_canvas: enabledcanvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|13, 21, 25| |Memory (System)|32.00GB (4.41GB free)| |Process Argv|--crash-reporter-id cccdf885-8e7f-4939-93f0-2262e8602702| |Screen Reader|no| |VM|0%|
Extensions (29)
Extension|Author (truncated)|Version ---|---|--- better-comments|aar|3.0.2 vscode-tailwindcss|bra|0.10.3 path-intellisense|chr|2.8.5 vscode-eslint|dba|2.4.2 es7-react-js-snippets|dsz|4.4.3 gitlens|eam|14.5.2 vscode-html-css|ecm|1.13.1 EditorConfig|Edi|0.16.4 prettier-vscode|esb|10.1.0 copilot|Git|1.141.0 copilot-chat|Git|0.11.0 copilot-labs|Git|0.17.1121 vscode-graphql-syntax|Gra|1.2.2 vscode-react-typescript|inf|1.3.1 path-autocomplete|ion|1.25.0 git-graph|mhu|1.30.0 cmake-tools|ms-|1.16.32 cpptools|ms-|1.18.5 cpptools-extension-pack|ms-|1.3.0 vscode-typescript-next|ms-|5.4.20231210 vsliveshare|ms-|1.0.5900 nativebase-v3-vscode-extension|Nat|0.1.3 back-n-forth|nic|3.1.1 phind|phi|0.16.7 autoimport|ste|1.5.4 cmake|twx|0.0.17 vscode-gradle|vsc|3.13.5 vscode-icons|vsc|12.6.0 material-theme|zhu|3.16.2 (1 theme extensions excluded)A/B Experiments
``` vsliv368:30146709 vsreu685:30147344 python383:30185418 vspor879:30202332 vspor708:30202333 vspor363:30204092 vswsl492:30256859 vslsvsres303:30308271 vserr242:30382549 pythontb:30283811 vsjup518:30340749 pythonptprofiler:30281270 vsdfh931:30280409 vshan820:30294714 vstes263:30335439 vscod805cf:30301675 binariesv615:30325510 bridge0708:30335490 bridge0723:30353136 vsaa593cf:30376535 pythonvs932:30410667 py29gd2263:30899288 vscaat:30438848 vsclangdf:30486550 c4g48928:30535728 dsvsc012:30540252 azure-dev_surveyone:30548225 282f8724:30602487 f6dab269:30613381 showlangstatbar:30737416 fixshowwlkth:30771522 showindicator:30805244 pythongtdpath:30769146 i26e3531:30792625 welcomedialogc:30910334 pythonnosmt12:30797651 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 dsvsc013:30795093 dsvsc014:30804076 dsvsc015:30845448 pythontestfixt:30902429 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 accentitlementsc:30887149 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 aa_t_chat:30882232 dsvsc019:30917259 ```