microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
101.15k stars 12.51k forks source link

TS Server fatal error: Cannot read property 'length' of undefined #45108

Closed pleasemarkdarkly closed 3 years ago

pleasemarkdarkly commented 3 years ago

Issue Type: Bug

❗️❗️❗️ Please fill in the sections below to help us diagnose the issue ❗️❗️❗️

TypeScript Version: 4.4.0-dev.20210715

Steps to reproduce crash

  1. Sorry, I am not sure. I was working on a Hardhat, Solidity, DAO project and this Issue Reporter popped up

TS Server Log ❗️Server logging disabled. To help us fix crashes like this, please enable logging by setting:

"typescript.tsserver.log": "verbose"

After enabling this setting, future crash reports will include the server log.

TS Server Error Stack Server: syntax

TypeError: Cannot read property 'length' of undefined
    at Object.escapeLeadingUnderscores (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:12314:28)
    at createBaseIdentifier (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:21916:35)
    at Object.createIdentifier (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:21928:24)
    at createIdentifier (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:31047:43)
    at createIdentifier (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:31051:24)
    at parseIdentifier (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:31071:20)
    at parsePrimaryExpression (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:34314:20)
    at parseMemberExpressionOrHigher (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:33783:30)
    at parseLeftHandSideExpressionOrHigher (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:33727:92)
    at parseUpdateExpression (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:33662:30)
    at parseUnaryExpressionOrHigher (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:33537:40)
    at parseBinaryExpressionOrHigher (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:33414:31)
    at parseAssignmentExpressionOrHigher (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:33047:24)
    at parseExpression (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:32994:24)
    at doOutsideOfContext (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:30577:20)
    at allowInAnd (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:30599:20)
    at parseExpressionOrLabeledStatement (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:34732:30)
    at parseStatement (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:34975:20)
    at parseListElement (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:31427:20)
    at parseList (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:31412:31)
    at parseSourceFileWorker (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:30380:30)
    at Object.parseSourceFile (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:30214:26)
    at Object.createSourceFile (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:30012:29)
    at Object.createLanguageServiceSourceFile (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:155900:29)
    at acquireOrUpdateDocument (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:128773:37)
    at Object.acquireDocumentWithKey (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:128739:20)
    at getOrCreateSourceFileByPath (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:156303:41)
    at Object.getOrCreateSourceFile [as getSourceFile] (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:156250:24)
    at findSourceFileWorker (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:112857:29)
    at findSourceFile (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:112767:26)
    at /Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:112719:85
    at getSourceFileFromReferenceWorker (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:112686:34)
    at processSourceFile (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:112719:13)
    at processRootFile (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:112529:13)
    at /Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:111396:67
    at Object.forEach (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:194:30)
    at Object.createProgram (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:111396:16)
    at synchronizeHostData (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:156180:26)
    at Proxy.getProgram (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:156312:13)
    at InferredProject.Project.updateGraphWorker (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:161301:53)
    at InferredProject.Project.updateGraph (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:161230:42)
    at ProjectService.assignOrphanScriptInfoToInferredProject (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:163393:25)
    at ProjectService.assignProjectToOpenedScriptInfo (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:165080:26)
    at /Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:165354:97
    at Object.flatMap (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:519:25)
    at ProjectService.applyChangesInOpenFiles (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:165354:41)
    at Session.handlers.ts.Map.ts.getEntries._a.<computed> (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:166512:46)
    at /Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:168443:88
    at IOSession.Session.executeWithRequestId (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:168434:28)
    at IOSession.Session.executeCommand (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:168443:33)
    at IOSession.Session.onMessage (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:168469:35)
    at Interface.<anonymous> (/Users/mark.phillips/.vscode/extensions/ms-vscode.vscode-typescript-next-4.4.20210715/node_modules/typescript/lib/tsserver.js:171068:31)
    at Interface.emit (events.js:315:20)
    at Interface._onLine (readline.js:337:10)
    at Interface._normalWrite (readline.js:482:12)
    at Socket.ondata (readline.js:194:10)
    at Socket.emit (events.js:315:20)
    at addChunk (internal/streams/readable.js:309:12)
    at readableAddChunk (internal/streams/readable.js:284:9)
    at Socket.Readable.push (internal/streams/readable.js:223:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:188:23)

VS Code version: Code 1.58.1 (2aeda6b18e13c4f4f9edf6667158a6b8d408874b, 2021-07-13T06:22:33.013Z) OS version: Darwin x64 20.5.0 Restricted Mode: No

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz (16 x 2400)| |GPU Status|2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled| |Load (avg)|2, 3, 4| |Memory (System)|64.00GB (8.33GB free)| |Process Argv|. --crash-reporter-id 40f3cf0b-4029-417f-b0fc-e3643ba36304| |Screen Reader|no| |VM|0%|
Extensions (64) Extension|Author (truncated)|Version ---|---|--- project-manager|ale|12.3.0 tailwindcss-extension-pack|and|1.1.4 tailwind-docs|aus|1.4.0 vscode-tailwindcss|bra|0.6.13 node-snippets|chr|1.3.2 path-intellisense|chr|2.3.0 bracket-pair-colorizer-2|Coe|0.2.1 vscode-mac-color-picker|dae|1.0.2 vscode-eslint|dba|2.1.23 javascript-ejs-support|Dig|1.3.1 gitlens|eam|11.6.0 el-vsc-product-icon-theme|ElA|0.1.8 terminal|for|0.0.10 shell-format|fox|7.1.0 cursoruler|fre|0.0.4 copilot|Git|1.2.2024 remotehub-insiders|Git|2021.7.810 activitusbar|Gru|0.0.46 firebase-snippets|has|0.0.1 docker-linter|hen|0.5.0 headwind|hey|1.7.0 rest-client|hum|0.24.5 icon-fonts|idl|2.5.2 circleci-vscode|jod|0.2.2 firebase-explorer|jsa|0.3.3 solidity|Jua|0.0.124 autorun|kri|1.0.0 tailwind-sass-syntax|mac|1.3.0 rainbow-csv|mec|1.9.1 dotenv|mik|1.0.1 prettify-json|moh|0.0.3 mongodb-vscode|mon|0.6.0 python|ms-|2021.6.944021595 vscode-pylance|ms-|2021.7.4 jupyter|ms-|2021.8.1013163132 remote-containers|ms-|0.187.0 remote-ssh|ms-|0.65.7 remote-ssh-edit|ms-|0.65.7 remote-wsl|ms-|0.58.2 vscode-remote-extensionpack|ms-|0.21.0 vscode-typescript-next|ms-|4.4.20210715 vsliveshare|ms-|1.0.4580 vsliveshare-audio|ms-|0.1.91 vsliveshare-pack|ms-|0.4.0 debugger-for-chrome|msj|4.12.12 quicktype|qui|12.0.46 ethereum-remix|Rem|0.0.9 LiveServer|rit|5.6.1 mongo-snippets-for-node-js|roe|1.3.6 markdown-preview-enhanced|shd|0.5.22 code-spell-checker|str|1.10.2 svelte-vscode|sve|105.3.1 html-preview-vscode|tht|0.2.5 graphviz-interactive-preview|tin|0.0.11 vscode-inline-bookmarks|tin|0.0.23 vsfire|tob|1.4.1 terminal-tabs|Tyr|0.2.1 vscode-icons|vsc|11.5.0 gitmoji-vscode|Vtr|1.0.7 quokka-vscode|Wal|1.0.385 vscode-todo-highlight|way|1.0.4 change-case|wma|1.0.0 JavaScriptSnippets|xab|1.8.0 html-css-class-completion|Zig|1.20.0 (1 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vsreu685:30147344 python383:30185418 pythonvspyt602:30300191 vspor879:30202332 vspor708:30202333 vspor363:30204092 pythonvspyt639:30300192 pythontb:30283811 pythonvspyt551cf:30311713 vspre833:30321513 pythonptprofiler:30281270 vshan820:30294714 vstes263cf:30335440 vscoreces:30322571 pythondataviewer:30285071 vscus158:30321503 pythonvsuse255cf:30335482 vscod805:30301674 pythonvspyt200:30331937 vscextlang:30333561 binariesv615:30325510 vsccppwt:30329788 bridge0708:30335490 ```
vscodebot[bot] commented 3 years ago

(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

typescript-bot commented 3 years ago

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.