Skip to content

TypeError: Cannot read property 'charCount' of undefined in 'LineNode.charOffsetToLineInfo' during 'navtree' #21818

Closed
@aozgaa

Description

@aozgaa

This issue comes from crash dumps in telemetry. We've tried to de-duplicate issues on a best-effort basis, comparing the sequence of methods called and the command requested while ignoring line numbers.
TypeScript Version Prefix: 2.7.1
VSCode Version 1.19.2
command requested: navtree
hitting sessions: 406
proportion of all sessions: 0.0015156436072317851
five line hash: 78f8cedc7b3dcde1d4b897f52edf69f8
stack

TypeError: Cannot read property 'charCount' of undefined
    at LineNode.charOffsetToLineInfo (tsserver.js:91053:79)
    at LineIndex.positionToLineOffset (tsserver.js:90802:36)
    at ScriptVersionCache.positionToLineOffset (tsserver.js:90725:50)
    at TextStorage.positionToLineOffset (tsserver.js:84664:33)
    at ScriptInfo.positionToLineOffset (tsserver.js:84901:41)
    at IOSession.Session.toLocationTextSpan (tsserver.js:90084:39)
    at unknown (tsserver.js:90078:74)
    at Array.map (native)
    at IOSession.Session.toLocationNavigationTree (tsserver.js:90078:39)
    at IOSession.Session.getNavigationTree (tsserver.js:90094:32)
    at Session.handlers.ts.createMapFromTemplate._a.(anonymous function) (tsserver.js:89106:61)
    at unknown (tsserver.js:90393:88)
    at IOSession.Session.executeWithRequestId (tsserver.js:90384:28)
    at IOSession.Session.executeCommand (tsserver.js:90393:33)
    at IOSession.Session.onMessage (tsserver.js:90413:35)
    at Interface.<anonymous> (tsserver.js:91614:27)
    at emitOne (events.js:96:13)
    at Interface.emit (events.js:191:7)
    at Interface._onLine (readline.js:241:10)
    at Interface._normalWrite (readline.js:384:12)
    at Socket.ondata (readline.js:101:10)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:191:7)
    at readableAddChunk (_stream_readable.js:178:18)
    at Socket.Readable.push (_stream_readable.js:136:10)
    at Pipe.onread (net.js:560:20)

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issueSource: TelemetryThe issue relates to the telemetry in editors

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions