Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'symbol' of undefined in 'unknown' during 'completionInfo' #35036

Closed
typescript-bot opened this issue Nov 11, 2019 · 16 comments
Labels
Bug A bug in TypeScript Source: Telemetry The issue relates to the telemetry in editors

Comments

@typescript-bot
Copy link
Collaborator

typescript-bot commented Nov 11, 2019

This issue comes from crash dumps in telemetry. We've tried to de-duplicate issues on a best-effort basis, comparing the sequence of methods called and the command requested while ignoring line numbers.
TypeScript version prefix: 3.7.2
VSCode version: 1.40.0
Command requested: completionInfo
Hitting sessions: 644
Five line hash: f05606d1109b3c208a72950074c84f78
Stack:

    at <anonymous> (tsserver.js:106112:69)
    at forEach (tsserver.js:170:30)
    at get (tsserver.js:106105:24)
    at getSymbolsFromOtherSourceFileExports (tsserver.js:107235:79)
    at getGlobalCompletions (tsserver.js:107064:49)
    at tryGetGlobalSymbols (tsserver.js:106976:25)
    at getCompletionData (tsserver.js:106774:22)
    at getCompletionsAtPosition (tsserver.js:106138:34)
    at getCompletionsAtPosition (tsserver.js:130738:35)
    at Session.getCompletions (tsserver.js:140355:64)
    at _a.<computed> (tsserver.js:139335:61)
    at <anonymous> (tsserver.js:140870:88)
    at Session.executeWithRequestId (tsserver.js:140861:28)
    at Session.executeCommand (tsserver.js:140870:33)
    at Session.onMessage (tsserver.js:140893:35)
    at <anonymous> (tsserver.js:142208:27)
    at unknown (suppressed.js)
    at unknown (suppressed.js)
    at unknown (suppressed.js)
    at unknown (suppressed.js)
    at unknown (suppressed.js)
    at unknown (suppressed.js)
    at unknown (suppressed.js)
    at unknown (suppressed.js)
    at unknown (suppressed.js)
@asktree
Copy link

asktree commented Nov 20, 2019

I've been noticing this issue for the past few months (Windows), and have tried everything short of a reformat-- reinstalling, running in WSL, running my own Typescript version. Let me know if I can provide any information to help fix this.

@herberthobregon
Copy link

herberthobregon commented Nov 26, 2019

In my particular case it is a problem of firebase web. And its empty import...
in empty-import.d.ts

export = undefined

in this point, autocomplete of tsserver crash.

the solutions is to move the firebase into the some-package and install this package with yarn add file:./some-package

@Markonis
Copy link

Markonis commented Dec 2, 2019

I've just spent an hour trying to find a solution to this. Thanks @herberthobregon, indeed it was the Firebase SDK. For me the solution was even simpler. I just deleted the file empty-import.d.ts in node modules under the firebase package. Works fine for now...

@herberthobregon
Copy link

@Markonis The problem is when you install another dependency on your project, empty-import.d.ts will be added again. Eliminating it, I realized that this was the mistake, but to give you a permanent solution in what typescript links the solution to its main branch, you must do the above

@Markonis
Copy link

Markonis commented Dec 2, 2019

@herberthobregon Makes total sense, thanks! 👌 What about just commenting that line in the file?

@danielkcz
Copy link

danielkcz commented Dec 4, 2019

I was experiencing "low performance" of autocomplete in vscode for a few weeks now, but it was only with a specific project. Today I realized it might be tsserver related, I turned on logs for the first time ever and this error popped up there. Now I know why, yes, Firebase is the culprit. Thanks a lot for finding this, saves a lot of nerves :)

I wonder, has anyone reported it back to Firebase? Or what are the next steps here? Is it something that will be fixed on the TS side?

Nevermind, it seems to be already fixed, just not released yet firebase/firebase-js-sdk#2379.

@typescript-bot
Copy link
Collaborator Author

This issue reproduced in the following context:
TypeScript version prefix: 3.7.3
VSCode version: 1.41.0-insider
Command requested: completionInfo
Hitting sessions: 715
Five line hash: 6909d6521a82e0c77a1194f2718eb8c1
Stack:

TypeError: Cannot read property 'symbol' of undefined
    at unknown (tsserver.js:106146:69)
    at Object.forEach (tsserver.js:170:30)
    at Object.get (tsserver.js:106139:24)
    at getSymbolsFromOtherSourceFileExports (tsserver.js:107269:79)
    at getGlobalCompletions (tsserver.js:107098:49)
    at tryGetGlobalSymbols (tsserver.js:107010:25)
    at getCompletionData (tsserver.js:106808:22)
    at Object.getCompletionsAtPosition (tsserver.js:106172:34)
    at Proxy.getCompletionsAtPosition (tsserver.js:130772:35)
    at IOSession.Session.getCompletions (tsserver.js:140396:64)
    at Session.handlers.ts.createMapFromTemplate._a.<computed> (tsserver.js:139376:61)
    at unknown (tsserver.js:140911:88)
    at IOSession.Session.executeWithRequestId (tsserver.js:140902:28)
    at IOSession.Session.executeCommand (tsserver.js:140911:33)
    at IOSession.Session.onMessage (tsserver.js:140934:35)
    at Interface.<anonymous> (tsserver.js:142249:27)
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()

@herberthobregon
Copy link

@Markonis it is exactly the same, when you reinstall another dependency it will rewrite the file. as I said before, you should wrap firebase in a local package so that it does not index typescript server.

this is the temp solution 😪

@yamachu
Copy link

yamachu commented Dec 7, 2019

This issue maybe has solved by #35504
Could you try to use nightly typescript https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-typescript-next and set VSCode version 3.8.0-dev.20191206

image


ref: #35458
fixed?: #35232 #35370

@jassmith
Copy link

jassmith commented Jan 6, 2020

@yamachu just FYI the nightly does indeed solve the issue with firebase SDK.

@danvk
Copy link
Contributor

danvk commented Jan 8, 2020

Two things that would be helpful here:

  • vscode could surface this crash more explicitly. The way I experienced it was that I suddenly got lots of "No suggestions" for autocomplete in situations where there clearly were valid completions. I assumed it was some kind of language service timeout due to complicated types until I dug into the tsserver logs.

  • An easier way to disable bundled typings with bugs in them. I've tried adding node_modules/firebase/empty-import.d.ts to the exclude section in tsconfig.json as well as compilerOptions.paths but to no avail. For another example of where this would have been helpful, see Type RequestTransformFunction should be RequestTransformFunction alex3165/react-mapbox-gl#666

@typescript-bot
Copy link
Collaborator Author

This issue reproduced in the following context:
TypeScript version prefix: 3.7.4
VSCode version: 1.41.1
Command requested: completionInfo
Hitting sessions: 132
Five line hash: 6909d6521a82e0c77a1194f2718eb8c1
Stack:

TypeError: Cannot read property 'symbol' of undefined
    at unknown (tsserver.js:106154:69)
    at Object.forEach (tsserver.js:170:30)
    at Object.get (tsserver.js:106147:24)
    at getSymbolsFromOtherSourceFileExports (tsserver.js:107277:79)
    at getGlobalCompletions (tsserver.js:107106:49)
    at tryGetGlobalSymbols (tsserver.js:107018:25)
    at getCompletionData (tsserver.js:106816:22)
    at Object.getCompletionsAtPosition (tsserver.js:106180:34)
    at Object.getCompletionsAtPosition (tsserver.js:130780:35)
    at IOSession.Session.getCompletions (tsserver.js:140417:64)
    at Session.handlers.ts.createMapFromTemplate._a.<computed> (tsserver.js:139397:61)
    at unknown (tsserver.js:140932:88)
    at IOSession.Session.executeWithRequestId (tsserver.js:140923:28)
    at IOSession.Session.executeCommand (tsserver.js:140932:33)
    at IOSession.Session.onMessage (tsserver.js:140955:35)
    at Interface.<anonymous> (tsserver.js:142270:27)
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()

@vlafranca
Copy link

vlafranca commented Jan 14, 2020

I have the same error in vscode when triggering intellisense at the end (EOL) of a word, the intellisense is not working anymore after the exception is throwed up

@typescript-bot
Copy link
Collaborator Author

This issue reproduced in the following context:
TypeScript version prefix: 3.7.5
VSCode version: 1.41.1
Command requested: completionInfo
Hitting sessions: 322
Five line hash: 6909d6521a82e0c77a1194f2718eb8c1
Stack:

TypeError: Cannot read property 'symbol' of undefined
    at unknown (tsserver.js:106182:69)
    at Object.forEach (tsserver.js:170:30)
    at Object.get (tsserver.js:106175:24)
    at getSymbolsFromOtherSourceFileExports (tsserver.js:107305:79)
    at getGlobalCompletions (tsserver.js:107134:49)
    at tryGetGlobalSymbols (tsserver.js:107046:25)
    at getCompletionData (tsserver.js:106844:22)
    at Object.getCompletionsAtPosition (tsserver.js:106208:34)
    at Object.getCompletionsAtPosition (tsserver.js:130808:35)
    at IOSession.Session.getCompletions (tsserver.js:140445:64)
    at Session.handlers.ts.createMapFromTemplate._a.<computed> (tsserver.js:139425:61)
    at unknown (tsserver.js:140960:88)
    at IOSession.Session.executeWithRequestId (tsserver.js:140951:28)
    at IOSession.Session.executeCommand (tsserver.js:140960:33)
    at IOSession.Session.onMessage (tsserver.js:140983:35)
    at Interface.<anonymous> (tsserver.js:142298:27)
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()
    at suppressed_frame()

@sandersn
Copy link
Member

sandersn commented Mar 4, 2020

I think this is fixed now -- haven't seen any repros in over a month.

@sandersn sandersn closed this as completed Mar 4, 2020
@typescript-bot
Copy link
Collaborator Author

Revised stack format and updated hash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Source: Telemetry The issue relates to the telemetry in editors
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants