sveltejs / language-tools

The Svelte Language Server, and official extensions which use it
MIT License
1.26k stars 200 forks source link

ScriptKind Error with library projects #2538

Open datstarkey opened 1 month ago

datstarkey commented 1 month ago

Describe the bug

When working with a library project in a mono repo with the tsconfig module resolution set to : "moduleResolution": "NodeNext", it eventually starts getting this error on the svelte LSP, which eventually seems to cause the TS server or Svelte server to crash at some point and loses all intellisense.

Error: Debug Failure. False expression: Script kind should match provided ScriptKind:3 and sourceFile.scriptKind: 1, !entry: false
    at getDocumentRegistryEntry (c:\Users\{OMITTED}\.vscode\extensions\svelte.svelte-vscode-109.1.0\node_modules\typescript\lib\typescript.js:140976:11)
    at acquireOrUpdateDocument (c:\Users\{OMITTED}\.vscode\extensions\svelte.svelte-vscode-109.1.0\node_modules\typescript\lib\typescript.js:141006:32)
    at Object.updateDocumentWithKey (c:\Users\{OMITTED}\.vscode\extensions\svelte.svelte-vscode-109.1.0\node_modules\typescript\lib\typescript.js:140961:12)
    at getOrCreateSourceFileByPath (c:\Users\{OMITTED}\.vscode\extensions\svelte.svelte-vscode-109.1.0\node_modules\typescript\lib\typescript.js:149933:37)
    at Object.getOrCreateSourceFile (c:\Users\{OMITTED}\.vscode\extensions\svelte.svelte-vscode-109.1.0\node_modules\typescript\lib\typescript.js:149919:14)
    at c:\Users\{OMITTED}\.vscode\extensions\svelte.svelte-vscode-109.1.0\node_modules\typescript\lib\typescript.js:149840:42
    at Object.getSourceFileWithCache [as getSourceFile] (c:\Users\{OMITTED}\.vscode\extensions\svelte.svelte-vscode-109.1.0\node_modules\typescript\lib\typescript.js:124075:24)
    at findSourceFileWorker (c:\Users\{OMITTED}\.vscode\extensions\svelte.svelte-vscode-109.1.0\node_modules\typescript\lib\typescript.js:126536:23)
    at findSourceFile (c:\Users\{OMITTED}\.vscode\extensions\svelte.svelte-vscode-109.1.0\node_modules\typescript\lib\typescript.js:126452:20)
    at processImportedModules (c:\Users\{OMITTED}\.vscode\extensions\svelte.svelte-vscode-109.1.0\node_modules\typescript\lib\typescript.js:126852:11)

I've only been able to reliably reproduce it by removing the Githubissues.

  • Githubissues is a development platform for aggregating issues.