Skip to content

Navtree error in 3.7 for object with dynamic property names #34569

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

Closed
jrieken opened this issue Oct 18, 2019 · 7 comments
Closed

Navtree error in 3.7 for object with dynamic property names #34569

jrieken opened this issue Oct 18, 2019 · 7 comments
Assignees
Labels
Bug A bug in TypeScript Duplicate An existing issue was already created

Comments

@jrieken
Copy link
Member

jrieken commented Oct 18, 2019

TypeScript Version: 3.7.0-dev.20191017

Search terms

  • Navtree
  • outline

repo

  1. In the vs code code base, open:https://github.com/microsoft/vscode/blob/master/src/vs/base/common/uri.ts

bug
no outline, these error appear on the console

ERR <syntax> TypeScript Server Error (3.7.0-dev.20191017)
Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
    at Object.unescapeLeadingUnderscores (tsserver.js:14545:19)
    at tryGetName (tsserver.js:112644:27)
    at compareChildren (tsserver.js:112630:53)
    at Array.sort (<anonymous>)
    at sortChildren (tsserver.js:112627:22)
    at endNode (tsserver.js:112210:17)
    at addNodeWithRecursiveChild (tsserver.js:112218:13)
    at addChildrenRecursively (tsserver.js:112299:25)
    at visitNodes (tsserver.js:17565:30)
    at Object.forEachChild (tsserver.js:17805:24)
    at addChildrenRecursively (tsserver.js:112444:24)
    at visitNode (tsserver.js:17556:24)
    at Object.forEachChild (tsserver.js:17803:21)
    at addChildrenRecursively (tsserver.js:112444:24)
    at rootNavigationBarNode (tsserver.js:112148:17)
    at Object.getNavigationTree (tsserver.js:112114:38)
    at Proxy.getNavigationTree (tsserver.js:130817:37)
    at IOSession.Session.getNavigationTree (tsserver.js:140321:44)
    at Session.handlers.ts.createMapFromTemplate._a.<computed> (tsserver.js:139215:61)
    at tsserver.js:140652:88
    at IOSession.Session.executeWithRequestId (tsserver.js:140643:28)
    at IOSession.Session.executeCommand (tsserver.js:140652:33)
    at IOSession.Session.onMessage (tsserver.js:140675:35)
    at Interface.<anonymous> (tsserver.js:141990: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: <syntax> TypeScript Server Error (3.7.0-dev.20191017)
Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
    at Object.unescapeLeadingUnderscores (tsserver.js:14545:19)
    at tryGetName (tsserver.js:112644:27)
    at compareChildren (tsserver.js:112630:53)
    at Array.sort (<anonymous>)
    at sortChildren (tsserver.js:112627:22)
    at endNode (tsserver.js:112210:17)
    at addNodeWithRecursiveChild (tsserver.js:112218:13)
    at addChildrenRecursively (tsserver.js:112299:25)
    at visitNodes (tsserver.js:17565:30)
    at Object.forEachChild (tsserver.js:17805:24)
    at addChildrenRecursively (tsserver.js:112444:24)
    at visitNode (tsserver.js:17556:24)
    at Object.forEachChild (tsserver.js:17803:21)
    at addChildrenRecursively (tsserver.js:112444:24)
    at rootNavigationBarNode (tsserver.js:112148:17)
    at Object.getNavigationTree (tsserver.js:112114:38)
    at Proxy.getNavigationTree (tsserver.js:130817:37)
    at IOSession.Session.getNavigationTree (tsserver.js:140321:44)
    at Session.handlers.ts.createMapFromTemplate._a.<computed> (tsserver.js:139215:61)
    at tsserver.js:140652:88
    at IOSession.Session.executeWithRequestId (tsserver.js:140643:28)
    at IOSession.Session.executeCommand (tsserver.js:140652:33)
    at IOSession.Session.onMessage (tsserver.js:140675:35)
    at Interface.<anonymous> (tsserver.js:141990: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 - Insiders.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:53:63498)
	at h.dispatchResponse (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:53:56653)
	at h.dispatchMessage (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:53:55551)
	at /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:53:55027
	at l.fire (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:50:652)
	at t.Reader.onLengthData (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:53:61718)
	at Socket.<anonymous> (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/typescript-language-features/dist/extension.js:53:61366)
	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)
@mjbvz mjbvz transferred this issue from microsoft/vscode Oct 18, 2019
@mjbvz
Copy link
Contributor

mjbvz commented Oct 18, 2019

Minimal repo:

enum CharCode {
    ExclamationMark = '!',
    DollarSign = '$'
}
const encodeTable = {
	[CharCode.ExclamationMark]: 1,
	[CharCode.DollarSign]: 1
};

This may be the same root cause as #33604

@RyanCavanaugh I think it's worth considering a bug fix for 3.7. According to telemetry, errors in unescapeLeadingUnderscores are the top hit errors for VS Code users on TS 3.7

@mjbvz mjbvz removed their assignment Oct 18, 2019
@mjbvz mjbvz changed the title Missing outline in uri.ts Navtree error in 3.7 for object with dynamic property names Oct 18, 2019
@jrieken
Copy link
Member Author

jrieken commented Oct 24, 2019

@RyanCavanaugh ping

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Oct 24, 2019
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.7.2 milestone Oct 24, 2019
@sandersn
Copy link
Member

@jrieken This should be fixed by #34631. Can you try typescript@next to confirm?

@sandersn
Copy link
Member

Duplicate of #34404 (the second stack reported in that bug)

@sandersn sandersn added the Duplicate An existing issue was already created label Oct 24, 2019
@jrieken
Copy link
Member Author

jrieken commented Oct 29, 2019

I still see this failing for 3.7.1-rc. @mjbvz Looks like TS isn't shipping this before 3.7.2. Are we really planning to ship 1.40 with 3.7.1? This is happens with multiple files in our repo and I see this as major breakage that will cause a storm in our inbox.

@mjbvz
Copy link
Contributor

mjbvz commented Oct 30, 2019

We are not planning to pick up TS 3.7 until the November release of VS Code. This should be fixed in TS next (3.8) and the fix was backported to the upcoming TypeScript 3.7.2 release. I'll pick that up for VS Code once it is released in early November

@jrieken
Copy link
Member Author

jrieken commented Oct 31, 2019

ok - I am relieved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants