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

TS Server fatal error: Cannot read property 'charCount' of undefined #114577

Closed
nol166 opened this issue Jan 19, 2021 · 4 comments
Closed

TS Server fatal error: Cannot read property 'charCount' of undefined #114577

nol166 opened this issue Jan 19, 2021 · 4 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@nol166
Copy link

nol166 commented Jan 19, 2021

Issue Type: Bug

❗️❗️❗️ Please fill in the sections below to help us diagnose the issue ❗️❗️❗️

TypeScript Version: 4.1.2

Steps to reproduce crash

  1. Create comments using command slash
  2. Save document with auto format enabled

TS Server Log
❗️Server logging disabled. To help us fix crashes like this, please enable logging by setting:

"typescript.tsserver.log": "verbose"

After enabling this setting, future crash reports will include the server log.

TS Server Error Stack
Server: syntax

TypeError: Cannot read property 'charCount' of undefined
    at LineNode.walk (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:158978:68)
    at LineIndex.edit (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:158859:31)
    at ScriptVersionCache._getSnapshot (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:158649:47)
    at ScriptVersionCache.lineOffsetToPosition (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:158668:29)
    at TextStorage.lineOffsetToPosition (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:150171:33)
    at ScriptInfo.lineOffsetToPosition (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:150526:41)
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:156412:56
    at Object.next (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:627:33)
    at ProjectService.applyChangesToFile (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:155405:46)
    at ProjectService.applyChangesInOpenFiles (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:155372:30)
    at Session.handlers.ts.Map.ts.getEntries._a.<computed> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:156403:46)
    at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:158276:88
    at IOSession.Session.executeWithRequestId (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:158267:28)
    at IOSession.Session.executeCommand (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:158276:33)
    at IOSession.Session.onMessage (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:158300:35)
    at Interface.<anonymous> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js:160510:27)
    at Interface.emit (events.js:315:20)
    at Interface._onLine (readline.js:329:10)
    at Interface._normalWrite (readline.js:474:12)
    at Socket.ondata (readline.js:186:10)
    at Socket.emit (events.js:315:20)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:271:9)
    at Socket.Readable.push (_stream_readable.js:212:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)

VS Code version: Code - Insiders 1.53.0-insider (32b28f6, 2021-01-19T06:10:41.343Z)
OS version: Darwin arm64 20.2.0

System Info
Item Value
CPUs undefined
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
protected_video_decode: unavailable_off
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 2, 2, 2
Memory (System) 16.00GB (0.32GB free)
Process Argv --crash-reporter-id e905019d-24d6-4a80-9e6d-01294d75c825
Screen Reader no
VM 0%
Extensions (9)
Extension Author (truncated) Version
better-comments aar 2.1.0
turbo-console-log Cha 2.1.6
bracket-pair-colorizer-2 Coe 0.2.0
vscode-eslint dba 2.1.14
es7-react-js-snippets dsz 3.1.0
prettier-vscode esb 5.8.0
vscode-open san 0.1.0
code-spell-checker str 1.10.2
markdown-all-in-one yzh 3.4.0
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368:30146709
vsreu685:30147344
openlogontheside:30221882
python383:30185418
vspyt653:30244269
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30208929
wsl2prompt:30219162
vstry914:30244316
pythonvsdeb440:30224570
unusedprompt:30219164
folderexplorer:30219166
openfilemenucf:30219169
pythonvsded773:30223139
pythonvspyt600cf:30241728
core-portspanel:30233467

@vscodebot
Copy link

vscodebot bot commented Jan 19, 2021

@mjbvz
Copy link
Contributor

mjbvz commented Jan 19, 2021

Can you share the source of the file that this is triggered in and how to trigger this bug in that file?

@mjbvz mjbvz added the info-needed Issue requires more information from poster label Jan 19, 2021
@nol166
Copy link
Author

nol166 commented Jan 20, 2021

To be honest with you, I can't remember what file I was working with. It was a React functional component and I was working on the jsx portion of a return. I will try to take better notes when and if this happens again. Should I enable verbose logging for the tsserver?

@mjbvz
Copy link
Contributor

mjbvz commented Feb 1, 2021

Yes please enable logging and let us know if you hit this again. Closing for now since we can't investigate without steps to reproduce or a log

@mjbvz mjbvz closed this as completed Feb 1, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants