TypeScript: Typescript service is often stopping working randomly: Cannot read property 'charCount' of undefined
From @asvetliakov on June 12, 2017 16:40
- VSCode Version: 1.13.0
- OS Version: macOS 10.12.5
May be related to #28112
I’m not sure how to reproduce it yet. It seems to happen randomly and VERY often. Steps:
- Edit your code (medium to large project)
- After some time the ts service stops working: 2.1. The validation messages are incorrect and have incorrect location 2.2. Completion and navigation features stops working
Typescript version: 2.3.3, also i didn’t have any issues with vscode 1.12.0
I’m getting this in typescript service output:
[Error - 6:32:24 PM] 'navtree' request failed with error.
Error processing request. Cannot read property 'charCount' of undefined
TypeError: Cannot read property 'charCount' of undefined
at LineNode.walk (/Users/asvetl/work/applications/frontend/node_modules/typescript/lib/tsserver.js:78490:47)
at LineIndex.edit (/Users/asvetl/work/applications/frontend/node_modules/typescript/lib/tsserver.js:78358:35)
at ScriptVersionCache.getSnapshot (/Users/asvetl/work/applications/frontend/node_modules/typescript/lib/tsserver.js:78150:47)
at TextStorage.getSnapshot (/Users/asvetl/work/applications/frontend/node_modules/typescript/lib/tsserver.js:73269:32)
at ScriptInfo.getSnapshot (/Users/asvetl/work/applications/frontend/node_modules/typescript/lib/tsserver.js:73378:41)
at LSHost.getScriptSnapshot (/Users/asvetl/work/applications/frontend/node_modules/typescript/lib/tsserver.js:73648:39)
at SyntaxTreeCache.getCurrentSourceFile (/Users/asvetl/work/applications/frontend/node_modules/typescript/lib/tsserver.js:71449:44)
at Object.getNavigationTree (/Users/asvetl/work/applications/frontend/node_modules/typescript/lib/tsserver.js:71953:71)
at IOSession.Session.getNavigationTree (/Users/asvetl/work/applications/frontend/node_modules/typescript/lib/tsserver.js:77613:62)
at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (/Users/asvetl/work/applications/frontend/node_modules/typescript/lib/tsserver.js:76670:61)
Full log: https://pastebin.com/X6xpSR1z
Thanks
Copied from original issue: Microsoft/vscode#28543
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 19 (2 by maintainers)
Commits related to this issue
- Adding test for #16456 to verify watched directories in case-sensitive and non sensitive file system and fixing caching — committed to microsoft/TypeScript by sheetalkamat 7 years ago
- Adding test for #16456 to verify watched directories in case-sensitive and non sensitive file system and fixing caching — committed to microsoft/TypeScript by sheetalkamat 7 years ago
I am not sure if my problem is exactly the same, but after having added some new files in the project, tsc began to crash with :
Tsc : 2.5.1 and 2.6.0-dev.20170829 Windows 10 64 bits Nodejs 8.4.0
I can provide ts server log if need be.
I haven’t seen the issue any more after upgrading to 2.5.2