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

TypeScript Server Error (5.2.2) on update to 1.82.0 #55673

Closed
TonyGravagno opened this issue Sep 7, 2023 · 24 comments
Closed

TypeScript Server Error (5.2.2) on update to 1.82.0 #55673

TonyGravagno opened this issue Sep 7, 2023 · 24 comments
Labels
External Relates to another program, environment, or user action which we cannot control.

Comments

@TonyGravagno
Copy link

Not sure if this can be reproduced yet. Just updated VSCode which includes TypeScript 5.2.2 and this error occurred. Will modify/update this report with proper process and logs if I can get more info. Given the extensions reported in this error, it's not apparent to me yet if this is a VSCode issue or an extensions issue, but "something" in the new update just broke "something", and I'm starting here with the diagnostics. Will also advise extension authors.

<semantic> TypeScript Server Error (5.2.2)
Debug Failure. False expression.
Error: Debug Failure. False expression.
    at _NodeTypingsInstaller.installPackage (c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:186191:13)
    at TypingsCache.installPackage (c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:175906:27)
    at ConfiguredProject2.installPackage (c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:176180:30)
    at applySingleCodeActionCommand (c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:144424:39)
    at Proxy.applyCodeActionCommand (c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:144419:96)
    at proxy.<computed> [as applyCodeActionCommand] (c:\Users\tonyg\.vscode\extensions\mxsdev.typescript-explorer-0.4.2\node_modules\@ts-type-explorer\typescript-plugin\dist\index.js:15:15)
    at proxy.<computed> [as applyCodeActionCommand] (c:\Users\tonyg\.vscode\extensions\paulshen.paul-typescript-toolkit-0.0.6\node_modules\typescript-extract-object-binding-type-literal-plugin\index.js:21:26)
    at proxy.<computed> (c:\Users\tonyg\.vscode\extensions\paulshen.paul-typescript-toolkit-0.0.6\node_modules\typescript-react-utils-plugin\index.js:21:26)
    at proxy.<computed> [as applyCodeActionCommand] (c:\Users\tonyg\.vscode\extensions\mxsdev.typescript-explorer-0.4.2\node_modules\@ts-type-explorer\typescript-plugin\dist\index.js:15:15)
    at proxy.<computed> [as applyCodeActionCommand] (c:\Users\tonyg\.vscode\extensions\paulshen.paul-typescript-toolkit-0.0.6\node_modules\typescript-extract-object-binding-type-literal-plugin\index.js:21:26)
    at proxy.<computed> (c:\Users\tonyg\.vscode\extensions\paulshen.paul-typescript-toolkit-0.0.6\node_modules\typescript-react-utils-plugin\index.js:21:26)
    at proxy.<computed> [as applyCodeActionCommand] (c:\Users\tonyg\.vscode\extensions\mxsdev.typescript-explorer-0.4.2\node_modules\@ts-type-explorer\typescript-plugin\dist\index.js:15:15)
    at proxy.<computed> [as applyCodeActionCommand] (c:\Users\tonyg\.vscode\extensions\paulshen.paul-typescript-toolkit-0.0.6\node_modules\typescript-extract-object-binding-type-literal-plugin\index.js:21:26)
    at proxy.<computed> (c:\Users\tonyg\.vscode\extensions\paulshen.paul-typescript-toolkit-0.0.6\node_modules\typescript-react-utils-plugin\index.js:21:26)
    at proxy.<computed> [as applyCodeActionCommand] (c:\Users\tonyg\.vscode\extensions\mxsdev.typescript-explorer-0.4.2\node_modules\@ts-type-explorer\typescript-plugin\dist\index.js:15:15)
    at proxy.<computed> [as applyCodeActionCommand] (c:\Users\tonyg\.vscode\extensions\paulshen.paul-typescript-toolkit-0.0.6\node_modules\typescript-extract-object-binding-type-literal-plugin\index.js:21:26)
    at proxy.<computed> (c:\Users\tonyg\.vscode\extensions\paulshen.paul-typescript-toolkit-0.0.6\node_modules\typescript-react-utils-plugin\index.js:21:26)
    at proxy.<computed> [as applyCodeActionCommand] (c:\Users\tonyg\.vscode\extensions\mxsdev.typescript-explorer-0.4.2\node_modules\@ts-type-explorer\typescript-plugin\dist\index.js:15:15)
    at proxy.<computed> [as applyCodeActionCommand] (c:\Users\tonyg\.vscode\extensions\paulshen.paul-typescript-toolkit-0.0.6\node_modules\typescript-extract-object-binding-type-literal-plugin\index.js:21:26)
    at proxy.<computed> (c:\Users\tonyg\.vscode\extensions\paulshen.paul-typescript-toolkit-0.0.6\node_modules\typescript-react-utils-plugin\index.js:21:26)
    at proxy.<computed> [as applyCodeActionCommand] (c:\Users\tonyg\.vscode\extensions\mxsdev.typescript-explorer-0.4.2\node_modules\@ts-type-explorer\typescript-plugin\dist\index.js:15:15)
    at proxy.<computed> [as applyCodeActionCommand] (c:\Users\tonyg\.vscode\extensions\paulshen.paul-typescript-toolkit-0.0.6\node_modules\typescript-extract-object-binding-type-literal-plugin\index.js:21:26)
    at proxy.<computed> (c:\Users\tonyg\.vscode\extensions\paulshen.paul-typescript-toolkit-0.0.6\node_modules\typescript-react-utils-plugin\index.js:21:26)
    at proxy.<computed> [as applyCodeActionCommand] (c:\Users\tonyg\.vscode\extensions\mxsdev.typescript-explorer-0.4.2\node_modules\@ts-type-explorer\typescript-plugin\dist\index.js:15:15)
    at proxy.<computed> [as applyCodeActionCommand] (c:\Users\tonyg\.vscode\extensions\paulshen.paul-typescript-toolkit-0.0.6\node_modules\typescript-extract-object-binding-type-literal-plugin\index.js:21:26)
    at proxy.<computed> (c:\Users\tonyg\.vscode\extensions\paulshen.paul-typescript-toolkit-0.0.6\node_modules\typescript-react-utils-plugin\index.js:21:26)
    at proxy.<computed> [as applyCodeActionCommand] (c:\Users\tonyg\.vscode\extensions\mxsdev.typescript-explorer-0.4.2\node_modules\@ts-type-explorer\typescript-plugin\dist\index.js:15:15)
    at proxy.<computed> [as applyCodeActionCommand] (c:\Users\tonyg\.vscode\extensions\paulshen.paul-typescript-toolkit-0.0.6\node_modules\typescript-extract-object-binding-type-literal-plugin\index.js:21:26)
    at proxy.<computed> [as applyCodeActionCommand] (c:\Users\tonyg\.vscode\extensions\paulshen.paul-typescript-toolkit-0.0.6\node_modules\typescript-react-utils-plugin\index.js:21:26)
    at IpcIOSession.applyCodeActionCommand (c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:184567:36)
    at applyCodeActionCommand (c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:182680:43)
    at c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:184838:69
    at IpcIOSession.executeWithRequestId (c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:184830:14)
    at IpcIOSession.executeCommand (c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:184838:29)
    at IpcIOSession.onMessage (c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:184880:51)
    at process.<anonymous> (c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js:186461:14)
    at process.emit (node:events:513:28)
    at emit (node:internal/child_process:937:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

Version: 1.82.0 (system setup)
Commit: 8b617bd08fd9e3fc94d14adb8d358b56e3f72314
Date: 2023-09-06T22:07:07.438Z
Electron: 25.8.0
ElectronBuildId: 23503258
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19045

Current scenario: I just opened an existing workspace with a TypeScript / React project. Linting was reporting that lodash is not installed, but it is, and I believe this error displayed during a rebuild.

I will reload the environment to see if this reproduces, and will test with and without the extensions shown in the error to see if either one of them triggers the issue.

@mjbvz mjbvz transferred this issue from microsoft/vscode Sep 7, 2023
@mjbvz mjbvz removed their assignment Sep 7, 2023
@andrewbranch
Copy link
Member

The extensions in the stack trace are definitely a red flag to me; we often see proxying extensions like these fail to pass through all parameters and break after an internal API change in TS. I think that’s more than likely what’s happening, but let me know if you can reproduce with those extensions disabled.

@andrewbranch andrewbranch added the External Relates to another program, environment, or user action which we cannot control. label Sep 11, 2023
@ilyvion
Copy link

ilyvion commented Sep 13, 2023

I don't know if it's the same exact cause, but I'm also having trouble with VSCode after upgrading to TypeScript 5.2.2 (from 4.9.5) (I'm using "workspace version" rather than VSCode version, but my workspace version now happens to also be 5.2.2) with error messages that are exactly the same, even though the stack trace isn't. In 4.9.5, I didn't have any issues, but now, I intermittently and seemingly randomly start getting errors like this in the "Extension Host" log:

2023-09-13 08:58:09.467 [error] [vscode.typescript-language-features] provider FAILED
2023-09-13 08:58:09.467 [error] Error: <semantic> TypeScript Server Error (5.2.2)
Debug Failure. False expression.
Error: Debug Failure. False expression.
    at ConfiguredProject2.updateGraphWorker (c:\Users\alexs\Documents\Projects\qcext-client\node_modules\typescript\lib\tsserver.js:176958:11)
    at ConfiguredProject2.updateGraph (c:\Users\alexs\Documents\Projects\qcext-client\node_modules\typescript\lib\tsserver.js:176817:32)
    at ConfiguredProject2.updateGraph (c:\Users\alexs\Documents\Projects\qcext-client\node_modules\typescript\lib\tsserver.js:178072:24)
    at updateProjectIfDirty (c:\Users\alexs\Documents\Projects\qcext-client\node_modules\typescript\lib\tsserver.js:178525:35)
    at ConfiguredProject2.getLanguageService (c:\Users\alexs\Documents\Projects\qcext-client\node_modules\typescript\lib\tsserver.js:176428:7)
    at IpcIOSession.provideInlayHints (c:\Users\alexs\Documents\Projects\qcext-client\node_modules\typescript\lib\tsserver.js:183663:27)
    at provideInlayHints (c:\Users\alexs\Documents\Projects\qcext-client\node_modules\typescript\lib\tsserver.js:182825:43)
    at c:\Users\alexs\Documents\Projects\qcext-client\node_modules\typescript\lib\tsserver.js:184838:69
    at IpcIOSession.executeWithRequestId (c:\Users\alexs\Documents\Projects\qcext-client\node_modules\typescript\lib\tsserver.js:184830:14)
    at IpcIOSession.executeCommand (c:\Users\alexs\Documents\Projects\qcext-client\node_modules\typescript\lib\tsserver.js:184838:29)
    at IpcIOSession.onMessage (c:\Users\alexs\Documents\Projects\qcext-client\node_modules\typescript\lib\tsserver.js:184880:51)
    at process.<anonymous> (c:\Users\alexs\Documents\Projects\qcext-client\node_modules\typescript\lib\tsserver.js:186461:14)
    at process.emit (node:events:513:28)
    at emit (node:internal/child_process:937:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
	at n.create (c:\Users\alexs\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\typescript-language-features\dist\extension.js:2:860352)
	at g.w (c:\Users\alexs\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\typescript-language-features\dist\extension.js:2:855676)
	at g.u (c:\Users\alexs\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\typescript-language-features\dist\extension.js:2:854759)
	at ChildProcess.<anonymous> (c:\Users\alexs\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\typescript-language-features\dist\extension.js:2:854391)
	at ChildProcess.emit (node:events:513:28)
	at emit (node:internal/child_process:937:14)
	at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

and once this happens, I have to run the VSCode command TypeScript: Reload Project to get things back to normal. Sometimes I can code for an hour without it happening, and other times it happens after just a few minutes, but it keeps happening at irregular intervals. I notice it having happened mainly by Intellisense suddenly showing garbage. For instance, if I hover over action here, it tells me:
image
but moving over to payload, it loses the plot:
image
and here it is again after running TypeScript: Reload Project:
image

EDIT: Oh, just for completeness, here's my VSCode data, too:
Version: 1.82.0 (user setup)
Commit: 8b617bd08fd9e3fc94d14adb8d358b56e3f72314
Date: 2023-09-06T22:07:07.438Z
Electron: 25.8.0
ElectronBuildId: 23503258
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Windows_NT x64 10.0.19045

EDIT 2: I also just noticed version 1.82.1 was released, so I'll update to that one and see if the problem still remains.

@andrewbranch
Copy link
Member

@alexschrod that is definitely a totally different code path, but if you can repro it reliably, we’ll take a repro (preferred) or TS Server logs!

@Daydreamer-riri
Copy link

Daydreamer-riri commented Sep 15, 2023

@alexschrod I encountered the same mistake.

@andrewbranch I've been able to consistently reproduce this problem in all of my repo using typescript@5.2.2(workspace versioin)

@andrewbranch
Copy link
Member

Can you provide a repo and instructions on how to reproduce?

@juancampa
Copy link

juancampa commented Sep 17, 2023

I've also run into this issue with typescript 5.2.2 (The second callstack in this issue posted by @alexschrod). I spent some time debugging the ts server locally, and this is what I've gathered so far, in case it's useful:

  • This is the assertion being triggered
  • I also have a plugin. My plugin calls languageService.getProgram() which triggers the creation of a new Program, which in turn causes the above assertion to fail in updateGraphWorker (because the old program and the new program are different objects)
  • Work around: The assertion doesn't happen if I use languageService.getCurrentProgram() instead. However, this seems like a private API function, so it's not listed in tsserverlibrary. This is definitely hacky and I'm not sure if its masking other issues.

@Daydreamer-riri
Copy link

Can you provide a repo and instructions on how to reproduce?

I found my problem due to TypeScript-Plugin-CSS-MODULES. I no longer use it anymore

@andrewbranch andrewbranch closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2023
@sheetalkamat
Copy link
Member

The plugins shouldnt be using languageService.getProgram() instead project.getProgram() to ensure there is no issue with synchronization between LS and project. This looks like external issue with the plugin rather than Typescript itself

@juancampa
Copy link

@sheetalkamat there doesn't seem to be a getProgram() in Project afaict. Any ideas?

@andrewbranch
Copy link
Member

getCurrentProgram()

@juancampa
Copy link

That does seem to work, and I can see how it's better than using languageService.getCurrentProgram. It is still marked @internal though. Does it make sense for it to not be?

@andrewbranch
Copy link
Member

Hm, I didn’t realize that. @sheetalkamat?

@sheetalkamat
Copy link
Member

Sorry. Got this wrong the first time. its project.getLanguageService().getProgram()

This makes sure that language service gets updated through project and the states are matched.

@mrmckeb
Copy link

mrmckeb commented Sep 20, 2023

Hi all, we've just had a report that typescript-plugin-css-modules is causing an issue here, but I'm not sure where the issue is. We are definitely not making use of getCurrentProgram or getProgram in the plugin. We did a big cleanup of the plugin for TypeScript 5.x too.

Was there anything in the 5.2 release that changed regarding plugins?

For reference, we're using:

  • languageServiceHost.getResolvedModuleWithFailedLookupLocationsFromCache
  • languageServiceHost.getScriptKind
  • languageServiceHost.getScriptSnapshot
  • languageServiceHost.resolveModuleNameLiterals
  • project.getCompilerOptions
  • project.getCurrentDirectory
  • project.getFileNames

(Source: https://github.com/mrmckeb/typescript-plugin-css-modules/blob/main/src/index.ts)

@sheetalkamat
Copy link
Member

@mrmckeb having the tsserver logs with repro would help with debugging.

@mrmckeb
Copy link

mrmckeb commented Sep 22, 2023

Unfortunately I've been unable to reproduce the issue (although the only information I have is that removing the plugin resolved the issue). I tested by creating a new Next.js app (with TypeScript 5.2.2), installing/configuring the plugin, and writing code in that app.

@alexschrod and @Daydreamer-riri, you've both reported that you had issues here:

  • Could you please provide additional information?
  • Did you both have the latest version of the plugin installed (v5.x, which as fixes for TypeScript 5.x)?

@Daydreamer-riri
Copy link

Unfortunately I've been unable to reproduce the issue (although the only information I have is that removing the plugin resolved the issue). I tested by creating a new Next.js app (with TypeScript 5.2.2), installing/configuring the plugin, and writing code in that app.

@alexschrod and @Daydreamer-riri, you've both reported that you had issues here:

  • Could you please provide additional information?
  • Did you both have the latest version of the plugin installed (v5.x, which as fixes for TypeScript 5.x)?

Hi, @mrmckeb, My application is in a monorepo managed by pnpm, and the plugin is v5.0.1

@mrmckeb
Copy link

mrmckeb commented Sep 22, 2023

Hi @Daydreamer-riri, I'm also using pnpm and still wasn't able to reproduce after moving to a monorepo.

  • Are you able to either provide a reproduction?
    • If not, can you provide TS server logs (as @andrewbranch suggested)?
  • Are you using any other plugins alongside this one?

@Daydreamer-riri
Copy link

Sorry, I forgot to take the screenshot.
According to my search history, the last log in every repetition is Starting updateGraphWorker: Project: d:/Users/ding.zhao/workspace/dingzhi-ctrip-bloc/projects/h5-project/tsconfig.json

@ekilah
Copy link

ekilah commented Oct 23, 2023

I have seen this happen with typescript-plugin-css-modules as well, coming over from debugging mrmckeb/typescript-plugin-css-modules#243

TS 5.2.2, typescript-plugin-css-modules 5.0.2

I don't know how unique my situation is, but I can repro the issue every time by the following:

  • Open my IDE (Webstorm), wait for the typescript service to warm up (waiting for errors to show in line, about 10-20 seconds or whatever)
  • Make a whitespace change in my tsconfig (I have a tsconfig.base.json that tsconfig.json "extends" for unrelated reasons. making a whitespace change in either file triggers the issue)
  • The errors show up in the TS server logs, and I lose TS hints in the IDE

Here's a full log from a session where I reproduced the error by doing the above:

https://gist.githubusercontent.com/ekilah/a21f0d44d3d591f46807eeef2207636a/raw/3b3c9a431567033fa652de4a5a90ae610445a93b/tsserver.log

at about 16:42:01, I added the whitespace. That starts about here in the log

Info 1953 [16:42:01.468] request:
    {"sessionId":1698104435420,"seq":81,"type":"request","command":"reloadProjects","arguments":{"projectFileName":"/Users/monroe/dev/ekilah/deal-web/tsconfig.base.json"}}
Info 1954 [16:42:01.468] reload projects

shortly after we get a bunch of spam like this:

Info 4138 [16:42:01.492] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one
Info 4139 [16:42:01.492] Scheduled: /Users/monroe/dev/ekilah/deal-web/tsconfig.base.json, Cancelled earlier one
Info 4140 [16:42:01.492] Scheduled: /Users/monroe/dev/ekilah/deal-web/tsconfig.base.json, Cancelled earlier one
Info 4141 [16:42:01.492] Scheduled: /Users/monroe/dev/ekilah/deal-web/tsconfig.json, Cancelled earlier one
Info 4142 [16:42:01.492] Scheduled: *ensureProjectForOpenFiles*, Cancelled earlier one
Info 4143 [16:42:01.492] Scheduled: /Users/monroe/dev/ekilah/deal-web/tsconfig.base.json, Cancelled earlier one
Info 4144 [16:42:01.492] Scheduled: /Users/monroe/dev/ekilah/deal-web/tsconfig.base.json, Cancelled earlier one
Info 4145 [16:42:01.492] Scheduled: /Users/monroe/dev/ekilah/deal-web/tsconfig.json, Cancelled earlier one

then we get this

Info 4950 [16:42:01.502] Reloading configured project /Users/monroe/dev/ekilah/deal-web/tsconfig.json
Info 4951 [16:42:01.502] event:
    {
     "seq": 0,
     "type": "event",
     "event": "projectLoadingStart",
     "body": {
      "projectName": "/Users/monroe/dev/ekilah/deal-web/tsconfig.json",
      "reason": "User requested reload projects"
     }
    }

which eventually finishes

Info 5350 [16:42:02.599] -----------------------------------------------
Info 5351 [16:42:02.599] Project '/dev/null/autoImportProviderProject1*' (AutoImportProvider)
Info 5352 [16:42:02.599] 	Files (110)

Info 5353 [16:42:02.599] -----------------------------------------------
Info 5354 [16:42:02.609] event:
    {
     "seq": 0,
     "type": "event",
     "event": "projectLoadingFinish",
     "body": {
      "projectName": "/Users/monroe/dev/ekilah/deal-web/tsconfig.json"
     }
    }

but then another reload happens (not sure why there are 2 of these kinds of events? the "reason" changes, so perhaps this isn't a bug, idk)

    {"sessionId":1698104435420,"seq":83,"type":"request","command":"syntacticDiagnosticsSync","arguments":{"projectFileName":"/Users/monroe/dev/ekilah/deal-web/tsconfig.base.json","file":"/Users/monroe/dev/ekilah/deal-web/src/pages/Auth/SignIn/stateless.tsx"}}
Info 5419 [16:42:02.640] Reloading configured project /Users/monroe/dev/ekilah/deal-web/tsconfig.base.json
Info 5420 [16:42:02.640] event:
    {
     "seq": 0,
     "type": "event",
     "event": "projectLoadingStart",
     "body": {
      "projectName": "/Users/monroe/dev/ekilah/deal-web/tsconfig.base.json",
      "reason": "Change in config file detected"
     }
    }

after that second reload, we get this series of events that leads to the error:

Info 5422 [16:42:02.682] Enabling plugin typescript-plugin-css-modules from candidate paths: /Users/monroe/dev/ekilah/deal-web,/Applications/WebStorm.app/Contents/plugins/javascript-impl/jsLanguageServicesImpl/typescript,/Users/monroe/dev/ekilah/deal-web/node_modules/typescript/lib/tsserver.js/../../..
Info 5423 [16:42:02.682] Loading typescript-plugin-css-modules from /Users/monroe/dev/ekilah/deal-web (resolved to /Users/monroe/dev/ekilah/deal-web/node_modules)
Info 5424 [16:42:02.683] [typescript-plugin-css-modules] options: {}
Info 5425 [16:42:02.683] Plugin validation succeeded
Info 5426 [16:42:02.683] Loading global plugin tsc-ide-plugin
Info 5427 [16:42:02.683] Enabling plugin tsc-ide-plugin from candidate paths: /Users/monroe/dev/ekilah/deal-web,/Applications/WebStorm.app/Contents/plugins/javascript-impl/jsLanguageServicesImpl/typescript,/Users/monroe/dev/ekilah/deal-web/node_modules/typescript/lib/tsserver.js/../../..
Info 5428 [16:42:02.683] Loading tsc-ide-plugin from /Users/monroe/dev/ekilah/deal-web (resolved to /Users/monroe/dev/ekilah/deal-web/node_modules)
Info 5429 [16:42:02.683] Loading tsc-ide-plugin from /Applications/WebStorm.app/Contents/plugins/javascript-impl/jsLanguageServicesImpl/typescript (resolved to /Applications/WebStorm.app/Contents/plugins/javascript-impl/jsLanguageServicesImpl/typescript/node_modules)
Info 5430 [16:42:02.683] Plugin validation succeeded
Err 5431  [16:42:02.690] Exception on executing command {"sessionId":1698104435420,"seq":83,"type":"request","command":"syntacticDiagnosticsSync","arguments":{"projectFileName":"/Users/monroe/dev/ekilah/deal-web/tsconfig.base.json","file":"/Users/monroe/dev/ekilah/deal-web/src/pages/Auth/SignIn/stateless.tsx"}}:

    Debug Failure. False expression.

    Error: Debug Failure. False expression.
        at ConfiguredProject2.updateGraphWorker (/Users/monroe/dev/ekilah/deal-web/node_modules/typescript/lib/tsserver.js:176958:11)
        at ConfiguredProject2.updateGraph (/Users/monroe/dev/ekilah/deal-web/node_modules/typescript/lib/tsserver.js:176817:32)
        at ConfiguredProject2.updateGraph (/Users/monroe/dev/ekilah/deal-web/node_modules/typescript/lib/tsserver.js:178072:24)
        at _ProjectService.reloadConfiguredProject (/Users/monroe/dev/ekilah/deal-web/node_modules/typescript/lib/tsserver.js:179983:13)
        at ConfiguredProject2.updateGraph (/Users/monroe/dev/ekilah/deal-web/node_modules/typescript/lib/tsserver.js:178062:29)
        at updateProjectIfDirty (/Users/monroe/dev/ekilah/deal-web/node_modules/typescript/lib/tsserver.js:178525:35)
        at ConfiguredProject2.getLanguageService (/Users/monroe/dev/ekilah/deal-web/node_modules/typescript/lib/tsserver.js:176428:7)
        at /Users/monroe/dev/ekilah/deal-web/node_modules/typescript/lib/tsserver.js:183596:34
        at IOSession.getDiagnosticsWorker (/Users/monroe/dev/ekilah/deal-web/node_modules/typescript/lib/tsserver.js:183284:25)
        at IOSession.getSyntacticDiagnosticsSync (/Users/monroe/dev/ekilah/deal-web/node_modules/typescript/lib/tsserver.js:183592:17)
        at syntacticDiagnosticsSync (/Users/monroe/dev/ekilah/deal-web/node_modules/typescript/lib/tsserver.js:182518:43)
        at /Users/monroe/dev/ekilah/deal-web/node_modules/typescript/lib/tsserver.js:184838:69
        at IOSession.executeWithRequestId (/Users/monroe/dev/ekilah/deal-web/node_modules/typescript/lib/tsserver.js:184830:14)
        at IOSession.executeCommand (/Users/monroe/dev/ekilah/deal-web/node_modules/typescript/lib/tsserver.js:184838:29)
        at IOSession.onMessage (/Users/monroe/dev/ekilah/deal-web/node_modules/typescript/lib/tsserver.js:184880:51)
        at Interface.<anonymous> (/Users/monroe/dev/ekilah/deal-web/node_modules/typescript/lib/tsserver.js:186437:14)
        at Interface.emit (node:events:527:28)
        at Interface._onLine (node:readline:487:10)
        at Interface._normalWrite (node:readline:661:12)
        at Socket.ondata (node:readline:269:10)
        at Socket.emit (node:events:539:35)
        at addChunk (node:internal/streams/readable:315:12)
        at readableAddChunk (node:internal/streams/readable:285:11)
        at Socket.Readable.push (node:internal/streams/readable:228:10)
        at Pipe.onStreamRead (node:internal/stream_base_commons:190:23)

File text of /Users/monroe/dev/ekilah/deal-web/src/pages/Auth/SignIn/stateless.tsx:
{REDACTED}

@ekilah
Copy link

ekilah commented Oct 24, 2023

I don't appear to hit this crash on TS 5.1.3, which @mrmckeb suggested I try.

Logs for that are here: https://gist.githubusercontent.com/ekilah/2a3385653c2101a268d320a87bb83c95/raw/32941e2856a048b60170c3acdb2cc984416e39f5/tsserver-deal-web-5.1.3.log

This is about the spot in the log file where I added whitespace to my tsconfig file, to compare to the earlier logs, at 17:36:16:

Info 11056[17:36:16.041] request:
    {"sessionId":1698107736441,"seq":71,"type":"request","command":"reloadProjects","arguments":{"projectFileName":"/Users/monroe/dev/ekilah/deal-web/tsconfig.base.json"}}
Info 11057[17:36:16.041] reload projects.

@mrmckeb
Copy link

mrmckeb commented Oct 24, 2023

As this issue seems very rare (I know users on 5.2.2 that aren't hitting this issue), I'm hoping someone from the TS team can make some suggestions of what might be happening here?

Details:

  • This plugin has 275k downloads a week, yet we've only had a ~4 reports of this issue.
  • The issue occurs with 5.2.2, but not earlier TS 5.x versions.
  • The issue seems to occur in VS Code and Webstorm.
  • We haven't been able to get a clear reproduction, which means I can't debug this easily.

CC @sheetalkamat

@FDiskas
Copy link

FDiskas commented Oct 24, 2023

I tried 5.2.2 version and by trying to compile I got an error. Maybe it could help.

typescript v5.3.0-dev.20231024 - no errors

> tsc --noEmit


<--- Last few GCs --->

[16113:0x118008000]   167506 ms: Mark-Compact 4061.2 (4132.2) -> 4046.2 (4133.0) MB, 1070.00 / 0.00 ms  (average mu = 0.103, current mu = 0.024) allocation failure; scavenge might not succeed
[16113:0x118008000]   168610 ms: Mark-Compact 4062.0 (4133.0) -> 4046.9 (4134.0) MB, 1078.46 / 0.00 ms  (average mu = 0.065, current mu = 0.024) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x1028ff0cc node::Abort() [/opt/homebrew/Cellar/node/20.6.1/bin/node]
 2: 0x102900528 node::ModifyCodeGenerationFromStrings(v8::Local<v8::Context>, v8::Local<v8::Value>, bool) [/opt/homebrew/Cellar/node/20.6.1/bin/node]
 3: 0x102a6afa4 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/20.6.1/bin/node]
 4: 0x102a6af50 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/20.6.1/bin/node]
 5: 0x102bf56b4 v8::internal::Heap::CallGCPrologueCallbacks(v8::GCType, v8::GCCallbackFlags, v8::internal::GCTracer::Scope::ScopeId) [/opt/homebrew/Cellar/node/20.6.1/bin/node]
 6: 0x102bf8318 v8::internal::Heap::ComputeMutatorUtilization(char const*, double, double) [/opt/homebrew/Cellar/node/20.6.1/bin/node]
 7: 0x102bf6358 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) [/opt/homebrew/Cellar/node/20.6.1/bin/node]
 8: 0x102bf41d0 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/homebrew/Cellar/node/20.6.1/bin/node]
 9: 0x102bec19c v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/20.6.1/bin/node]
10: 0x102bec918 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/20.6.1/bin/node]
11: 0x102bd57b8 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/opt/homebrew/Cellar/node/20.6.1/bin/node]
12: 0x102ee4a20 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/Cellar/node/20.6.1/bin/node]
13: 0x10273cc44 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/opt/homebrew/Cellar/node/20.6.1/bin/node]
14: 0x12911ae18 
15: 0x128e528f0 
16: 0x128fdd7cc 
17: 0x128fd910c 
18: 0x128ff5cd0 
...

@contatoitalo
Copy link

I have the same problem:

<semantic> TypeScript Server Error (5.2.2) Debug Failure. False expression. Error: Debug Failure. False expression. at ConfiguredProject2.updateGraphWorker (C:\painel-cassino\node_modules\.pnpm\typescript@5.2.2\node_modules\typescript\lib\tsserver.js:176958:11) at ConfiguredProject2.updateGraph (C:\painel-cassino\node_modules\.pnpm\typescript@5.2.2\node_modules\typescript\lib\tsserver.js:176817:32) at ConfiguredProject2.updateGraph (C:\painel-cassino\node_modules\.pnpm\typescript@5.2.2\node_modules\typescript\lib\tsserver.js:178072:24) at updateProjectIfDirty (C:\painel-cassino\node_modules\.pnpm\typescript@5.2.2\node_modules\typescript\lib\tsserver.js:178525:35) at ConfiguredProject2.getLanguageService (C:\painel-cassino\node_modules\.pnpm\typescript@5.2.2\node_modules\typescript\lib\tsserver.js:176428:7) at IpcIOSession.organizeImports (C:\painel-cassino\node_modules\.pnpm\typescript@5.2.2\node_modules\typescript\lib\tsserver.js:184492:29) at organizeImports (C:\painel-cassino\node_modules\.pnpm\typescript@5.2.2\node_modules\typescript\lib\tsserver.js:182706:43) at C:\painel-cassino\node_modules\.pnpm\typescript@5.2.2\node_modules\typescript\lib\tsserver.js:184838:69 at IpcIOSession.executeWithRequestId (C:\painel-cassino\node_modules\.pnpm\typescript@5.2.2\node_modules\typescript\lib\tsserver.js:184830:14) at IpcIOSession.executeCommand (C:\painel-cassino\node_modules\.pnpm\typescript@5.2.2\node_modules\typescript\lib\tsserver.js:184838:29) at IpcIOSession.onMessage (C:\painel-cassino\node_modules\.pnpm\typescript@5.2.2\node_modules\typescript\lib\tsserver.js:184880:51) at process.<anonymous> (C:\painel-cassino\node_modules\.pnpm\typescript@5.2.2\node_modules\typescript\lib\tsserver.js:186461:14) at process.emit (node:events:514:28) at emit (node:internal/child_process:937:14) at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Relates to another program, environment, or user action which we cannot control.
Projects
None yet
Development

No branches or pull requests