When working on a TypeScript (v2.0+) project within 'Visual Studio Code' (v1.5.3) I get the following error:
[Error - 10:03:50 AM] 'format' request failed with error.
Error processing request. No Project.
Error: No Project.
...
I restarted visual-studio-code with verbose logging.
export TSS_LOG='-level verbose -file <my-home>/tss.log'
This gives a bit more information:
Info 1233 request: {"seq":522,"type":"request","command":"format","arguments":{"file":"/<my_project>/src/ts/<the-file>.ts","line":1,"offset":1,"endLine":616,"endOffset":1}}
Err 1234 Exception on executing command {"seq":522,"type":"request","command":"format","arguments":{"file":"/<my_project>/src/ts/<the-file>.ts","line":1,"offset":1,"endLine":616,"endOffset":1}}:
No Project.
Error: No Project.
at Errors (<my_global_node>/lib/node_modules/typescript/lib/tsserver.js:50793:32)
at ts.server.ts.server (<my_global_node>/lib/node_modules/typescript/lib/tsserver.js:50795:11)
at ts (<my_global_node>/lib/node_modules/typescript/lib/tsserver.js:51775:7)
at Object.<anonymous> (<my_global_node>/lib/node_modules/typescript/lib/tsserver.js:51776:3)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
Info 1235 response:
{"seq":0,"type":"response","command":"format","request_seq":522,"success":false,"message":"Error processing request. No Project.
Error: No Project.
at Errors (/home/fred/.nvm/versions/node/v6.5.0/lib/node_modules/typescript/lib/tsserver.js:50793:32)
at ts.server.ts.server (/home/fred/.nvm/versions/node/v6.5.0/lib/node_modules/typescript/lib/tsserver.js:50795:11)
at ts (/home/fred/.nvm/versions/node/v6.5.0/lib/node_modules/typescript/lib/tsserver.js:51775:7)
at Object.<anonymous> (/home/fred/.nvm/versions/node/v6.5.0/lib/node_modules/typescript/lib/tsserver.js:51776:3)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)"}
Does tsserver believe I do not have a project?
I have both a 'tsconfig.json' and 'jsconfig.json' file at the project directory root. I do have a 'tasks.json' that runs tsc. I can stimulate tsserver with other requests with a similar result.
{}
), suddenly I could "Restart TS Server" from the command palette without having it immediately crash. It is now able to handle all the files in my project without crashing; previously it could only handle half of them, probably because it was picking up neighboring projects since it couldn't find my project root. – Ignaciaignacio