-
-
Notifications
You must be signed in to change notification settings - Fork 63
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I am developing a TypeScript Language Service Plugin that loads CSS files using @volar/typescript.
In VS Code, you can create a new file via "New File...". Immediately after creation, it is not yet saved to the file system, and this state is called "untitled".
@volar/typescript appears unable to handle these untitled files correctly.
How to reproduce
minimum reproduction: https://github.com/mizdra/repro-volar-untitled-non-ts-file
- Run commands in your terminal
git clone [email protected]:mizdra/repro-volar-untitled-non-ts-file.git cd repro-volar-untitled-non-ts-file npm i
- Open the workspace in VS Code
- Run "Start extension in VS Code" debug task (F5)
- Create untitle file by Command+N
- Type
.foo {}in the file - Change language mode
CSS
2025-08-26.22.42.14.mov
Additional information
- It appears that tsserver is mistakenly processing the code as TypeScript.
- This issue occurs in both css-modules-kit and Vue (Official).
- css-modules-kit: Errors are reported in an untitled CSS file in VS Code mizdra/css-modules-kit#237
- Vue (Official):
- The
languageId not foundwarning was output totsserver.log. It might be related to this issue.- The warning comes from Volar.js.
volar.js/packages/language-core/index.ts
Line 57 in 762323e
console.warn(`languageId not found for ${id}`);
...
Info 112 [22:51:56.697] Loading typescript-plugin-css-modules from /Users/mizdra/src/localhost/gomi/repro-volar-untitled-non-ts-file/packages/vscode (resolved to /Users/mizdra/src/localhost/gomi/repro-volar-untitled-non-ts-file/packages/vscode/node_modules)
Info 113 [22:51:56.697] Plugin validation succeeded
Info 114 [22:51:56.698] Starting updateGraphWorker: Project: /dev/null/inferredProject1*
Err 115 [22:51:56.698] languageId not found for ^/untitled/ts-nul-authority/Untitled-1
...
sushichan044
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working

