Been getting this error for over year on various typescript versions. Saw this tweet and decided to finally do something about it.
Error:
ERR <semantic> TypeScript Server Error (3.7.3)
No Project.
Error: No Project.
at Object.ThrowNoProject (tsserver.js:133314:23)
at ScriptInfo.getDefaultProject (tsserver.js:134061:46)
at ProjectService.doEnsureDefaultProjectForFile (tsserver.js:136599:48)
at ProjectService.ensureDefaultProjectForFile (tsserver.js:136594:75)
at IOSession.Session.getFileAndProjectWorker (tsserver.js:140251:87)
at IOSession.Session.getFileAndProject (tsserver.js:140234:29)
at IOSession.Session.getDocumentHighlights (tsserver.js:140077:31)
at Session.handlers.ts.createMapFromTemplate._a.<computed> (tsserver.js:139501:61)
at tsserver.js:140929:88
at IOSession.Session.executeWithRequestId (tsserver.js:140920:28)
at IOSession.Session.executeCommand (tsserver.js:140929:33)
at IOSession.Session.onMessage (tsserver.js:140952:35)
at Interface.<anonymous> (tsserver.js:142267:27)
at Interface.emit (events.js:200:13)
at Interface._onLine (readline.js:314:10)
at Interface._normalWrite (readline.js:459:12)
at Socket.ondata (readline.js:170:10)
at Socket.emit (events.js:200:13)
at addChunk (_stream_readable.js:294:12)
at readableAddChunk (_stream_readable.js:275:11)
at Socket.Readable.push (_stream_readable.js:210:10)
at Pipe.onStreamRead (internal/stream_base_commons.js:166:17): Error: <semantic> TypeScript Server Error (3.7.3)
No Project.
Error: No Project.
at Object.ThrowNoProject (tsserver.js:133314:23)
at ScriptInfo.getDefaultProject (tsserver.js:134061:46)
at ProjectService.doEnsureDefaultProjectForFile (tsserver.js:136599:48)
at ProjectService.ensureDefaultProjectForFile (tsserver.js:136594:75)
at IOSession.Session.getFileAndProjectWorker (tsserver.js:140251:87)
at IOSession.Session.getFileAndProject (tsserver.js:140234:29)
at IOSession.Session.getDocumentHighlights (tsserver.js:140077:31)
at Session.handlers.ts.createMapFromTemplate._a.<computed> (tsserver.js:139501:61)
at tsserver.js:140929:88
at IOSession.Session.executeWithRequestId (tsserver.js:140920:28)
at IOSession.Session.executeCommand (tsserver.js:140929:33)
at IOSession.Session.onMessage (tsserver.js:140952:35)
at Interface.<anonymous> (tsserver.js:142267:27)
at Interface.emit (events.js:200:13)
at Interface._onLine (readline.js:314:10)
at Interface._normalWrite (readline.js:459:12)
at Socket.ondata (readline.js:170:10)
at Socket.emit (events.js:200:13)
at addChunk (_stream_readable.js:294:12)
at readableAddChunk (_stream_readable.js:275:11)
at Socket.Readable.push (_stream_readable.js:210:10)
at Pipe.onStreamRead (internal/stream_base_commons.js:166:17)
at Function.create (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:1:47388)
at h.dispatchResponse (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:1:206557)
at h.dispatchMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:1:205455)
at /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:1:204931
at l.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:46:893)
at t.Reader.onLengthData (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:1:212021)
at Socket.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:1:211669)
at Socket.emit (events.js:200:13)
at addChunk (_stream_readable.js:294:12)
at readableAddChunk (_stream_readable.js:275:11)
at Socket.Readable.push (_stream_readable.js:210:10)
at Pipe.onStreamRead (internal/stream_base_commons.js:166:17)
TypeScript Version: 3.7.3
Expected behavior:
TypeScript server to just work
Actual behavior:
Suggestions/hints stop working, autocomplete stops working, under random, extreme circumstances I'll lose syntax highlighting
@dereknelson Thank you for the log! Is there a project we can open locally to investigate with?
@RyanCavanaugh all the projects I work with are private, however there is one I'm willing to zip and share (minus some sensitive stuff) would that work?
@dereknelson Can do. [email protected]
@RyanCavanaugh hey, been on vacation - just emailed you
I get the same/similar error when trying to 'Rename Symbol' or press F2 in VS Code. Could it be the same issue?
+1 with
Error:
+1 with 3.7.5 as well
was having this for the past 2 months suddenly -- then I realized there were some directories I was able to exclude and everything worked again. Really odd though as I have 16GB RAM and most of it usually available if VSCode/TS needed it..
I'm having this error on Typescript 3.7.2 when I execute Find all References on vscode.
I think this could have been fixed by microsoft/TypeScript#38429 ?
+1 with 3.9.4. It seems to me that this exception triggers once the project reaches a certain treshold of inclusions in the tsconfig.json file . Once I minimized the surface there I got rid of the exception.
I got this when I press F2. Using VSCode 1.48.2.
I am getting that error when I press F2 to rename a ts variable
I see this on "Find All References" and "Rename Symbol" operations that trigger large project loads as well. After debugging tsserver to inspect process state, I realized that it's actually the next tsserver process throwing the "No project" error. The first process that I was inspecting simply crashed after running out of memory. (The Chrome debugger showed "paused before potential out-of-memory exception".) VSCode then spun up a second tsserver process to get it to takeover the reference search.
I think this specific exception is a VSCode bug. VSCode should probably detect when tsserver exits unexpectedly and cancel requests that require a project loaded. Instead it's still doing projectInfo commands before openFile commands.
Log of second tsserver here: https://gist.github.com/gluxon/743888c904478fbfbd02ad495aeccd7c
That would be vscode issue. @mjbvz to take a look.
(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:
This may be fixed by 7c6994d1b5907d688b079c06901505d646e89091, which adds a check to make sure the current file is open before making a request. Having trouble verifying this though since I'm not sure of the exact steps to reproduce the original issue
Let me know if you still see this issue in tomorrow's VS Code build
@mjbvz Thank you!
Having trouble verifying this though since I'm not sure of the exact steps to reproduce the original issue
It's definitely a difficult issue to reproduce. I suspect killing the tsserver process while it's in the middle of doing "Find All References"/"Rename Symbol" may reproduce it, but you need a large enough repository so those operations take more than a few seconds.
This may be fixed by 7c6994d, which adds a check to make sure the current file is open before making a request.
Let me know if you still see this issue in tomorrow's VS Code build
The nuance of this issue is that the "No Project" error is just a symptom of certain editor operations causing tsserver to run out of memory and crash. The specific "No Project" error will likely be fixed by your commit.
But separately, users still see their memory intensive editor operations take a long time and ultimately no-op. To reduce confusion, should VSCode perhaps notify users when tsserver crash? At the moment the crash is fairly transparent without any message in the UI or developer tools console. This behavior leaves users confused and not know what happened with their reference search or rename.
Most helpful comment
I get the same/similar error when trying to 'Rename Symbol' or press F2 in VS Code. Could it be the same issue?