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

VSCode plugin: Script kind should match provided ScriptKind:1 #793

Open
davidtaylorhq opened this issue Jan 28, 2025 · 0 comments
Open

VSCode plugin: Script kind should match provided ScriptKind:1 #793

davidtaylorhq opened this issue Jan 28, 2025 · 0 comments

Comments

@davidtaylorhq
Copy link

davidtaylorhq commented Jan 28, 2025

When using the VSCode Glint plugin on our codebase, it regularly breaks down with this error:

Glint encountered an error computing diagnostics for this file. This is likely a bug in Glint; please file an issue, including any code and/or steps to follow to reproduce the error.

Error: Debug Failure. False expression: Script kind should match provided ScriptKind:1 and sourceFile.scriptKind: 3, !entry: false
    at getDocumentRegistryEntry (/Users/david/discourse/discourse/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:142581:11)
    at Object.releaseDocumentWithKey (/Users/david/discourse/discourse/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:142675:19)
    at Object.getOrCreateSourceFileByPath [as getSourceFileByPath] (/Users/david/discourse/discourse/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:151555:30)
    at tryReuseStructureFromOldProgram (/Users/david/discourse/discourse/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:126294:59)
    at createProgram (/Users/david/discourse/discourse/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:125689:23)
    at synchronizeHostDataWorker (/Users/david/discourse/discourse/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:151491:15)
    at synchronizeHostData (/Users/david/discourse/discourse/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:151386:7)
    at Object.getProgram (/Users/david/discourse/discourse/node_modules/.pnpm/[email protected]/node_modules/typescript/lib/typescript.js:151568:5)
    at GlintLanguageServer.isAnalyzableFile (file:///Users/david/discourse/discourse/node_modules/.pnpm/@[email protected][email protected]/node_modules/@glint/core/lib/language-server/glint-language-server.js:493:36)
    at GlintLanguageServer.findDiagnosticsSource (file:///Users/david/discourse/discourse/node_modules/.pnpm/@[email protected][email protected]/node_modules/@glint/core/lib/language-server/glint-language-server.js:474:18)
Image

We're using the stable version of Glint (1.5.2), and the officially-released Glint plugin. Typescript version 5.7.3. Our codebase is entirely .js and .gjs files - no typescript. @builtin VSCode typescript extension is disabled.

Running VSCode's "restart extension host" can resolve the issue temporarily, but then it returns as soon as you change a single character in the file. If I fully restart VSCode, then it sometimes works for a bit longer before breaking down again. I haven't been able to find a specific sequence of actions which reproduces the problem on every machine.

Does anyone have any ideas about the cause? Or a way that I can collect more information about what's happening?

@davidtaylorhq davidtaylorhq changed the title VSCode plugin: Script kind should match provided ScriptKind:1 and sourceFile.scriptKind: 3, !entry: false VSCode plugin: Script kind should match provided ScriptKind:1 Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant