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

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)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 8
  • Comments: 16 (2 by maintainers)

Most upvoted comments

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…

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

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 https://github.com/alex3165/react-mapbox-gl/issues/666

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

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 https://github.com/firebase/firebase-js-sdk/pull/2379.