Skip to content

TSServer completions request: Cannot read property 'forEach' of undefined #16610

Closed
@mattbierner

Description

@mattbierner

TypeScript Version: 2.4.1-insiders20170615

While working in a TS file with VS code, I see this error from the TSServer:

[Trace  - 12:37:05 PM] Response received: completions (4494). Request took 20 ms. Success: false . Message: Error processing request. Cannot read property 'forEach' of undefined
TypeError: Cannot read property 'forEach' of undefined
    at symbolsToArray (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:27957:20)
    at Object.getExportsOfModuleAsArray [as getExportsOfModule] (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:24310:20)
    at symbolCanbeReferencedAtTypeLocation (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:62880:55)
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:62844:36
    at Object.filter (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:1439:25)
    at filterGlobalCompletion (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:62830:27)
    at tryGetGlobalSymbols (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:62826:27)
    at getCompletionData (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:62718:22)
    at Object.getCompletionsAtPosition (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:62338:34)
    at Object.getCompletionsAtPosition (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:74358:35)

Not sure how to reliable reproduce it yet

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions