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

TS server to crash repeatedly when include large js file (> 4 * 1024 * 1024) #4278

Closed
skywalker512 opened this issue Apr 17, 2024 · 1 comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first upstream

Comments

@skywalker512
Copy link

skywalker512 commented Apr 17, 2024

I found many issues indicating that their TS server crashed 5 times. Closing the hybridMode does not seem to solve the problem. I found a reproducible case, not sure if it is helpful.(The following cases have all enabled the hybridMode.)

Reproduce repo

https://github.com/skywalker512/volar-ts-crash

I found that this.info.containingProjects is empty when processing getFileTextAndSize, which should be the cause of the problem. I don't have time to explore how to fix it specifically.

{
  "host": {
    "args": [
      "--useInferredProjectPerProjectRoot",
      "--enableTelemetry",
      "--cancellationPipeName",
      "/tmp/vscode-typescript1000/13eef4b8378caca17dc2/tscancellation-0bffe2ec6ac9be6b2546.tmp*",
      "--logVerbosity",
      "verbose",
      "--logFile",
      "/home/sky/.vscode-server/data/logs/20240417T212226/exthost5/vscode.typescript-language-features/tsserver-log-sxf60c/tsserver.log",
      "--globalPlugins",
      "typescript-vue-plugin-bundle",
      "--pluginProbeLocations",
      "/home/sky/.vscode-server/extensions/vue.volar-2.0.12",
      "--locale",
      "en",
      "--noGetErrOnBackgroundUpdate",
      "--validateDefaultNpmLocation",
      "--useNodeIpc"
    ],
    "newLine": "\n",
    "useCaseSensitiveFileNames": true,
    "debugMode": false
  },
  "fileName": "xxx/index.mjs",
  "scriptKind": 1,
  "hasMixedContent": false,
  "path": "xxx/index.mjs",
  "containingProjects": [],
  "isDynamic": false,
  "textStorage": {
    "host": {
      "args": [
        "--useInferredProjectPerProjectRoot",
        "--enableTelemetry",
        "--cancellationPipeName",
        "/tmp/vscode-typescript1000/13eef4b8378caca17dc2/tscancellation-0bffe2ec6ac9be6b2546.tmp*",
        "--logVerbosity",
        "verbose",
        "--logFile",
        "/home/sky/.vscode-server/data/logs/20240417T212226/exthost5/vscode.typescript-language-features/tsserver-log-sxf60c/tsserver.log",
        "--globalPlugins",
        "typescript-vue-plugin-bundle",
        "--pluginProbeLocations",
        "/home/sky/.vscode-server/extensions/vue.volar-2.0.12",
        "--locale",
        "en",
        "--noGetErrOnBackgroundUpdate",
        "--validateDefaultNpmLocation",
        "--useNodeIpc"
      ],
      "newLine": "\n",
      "useCaseSensitiveFileNames": true,
      "debugMode": false
    },
    "info": "[Circular]",
    "isOpen": false,
    "ownFileText": false,
    "pendingReloadFromDisk": false,
    "version": 0
  },
  "fileWatcher": {}
}
@skywalker512
Copy link
Author

I think this submission caused the problem. volarjs/volar.js@79e50fa

The original getScriptSnapshot of typescript called getOrCreateScriptInfoAndAttachToProject, However, updateVirtualScript called languageServiceHost.getScriptVersion which called getOrCreateScriptInfoNotOpenedByClient not set .info.containingProjects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first upstream
Projects
None yet
Development

No branches or pull requests

2 participants