Repository navigation
Closed
Description
Two cases that can 100% reproduce (both on the monaco website and other places):
- Consider the following code:
func({
test: function() {
},
test() {
}
})When hovering over the first test function, an error will be thrown:
Uncaught Error: Cannot read property 'target' of undefined
TypeError: Cannot read property 'target' of undefined
at Object.y [as buildSignatureDisplay] (typescriptServices.js:38)
at typescriptServices.js:57
at p (typescriptServices.js:57)
at Object.m [as signatureToDisplayParts] (typescriptServices.js:57)
at f (typescriptServices.js:60)
at Object.i [as getSymbolDisplayPartsDocumentationAndSymbolKind] (typescriptServices.js:60)
at Object.y [as getQuickInfoAtPosition] (typescriptServices.js:63)
at e.getQuickInfoAtPosition (worker.js:9)
at t.e.fmr (workerMain.js:7)
at t._handleMessage (workerMain.js:7)
at Object.y [as buildSignatureDisplay] (typescriptServices.js:38)
at typescriptServices.js:57
at p (typescriptServices.js:57)
at Object.m [as signatureToDisplayParts] (typescriptServices.js:57)
at f (typescriptServices.js:60)
at Object.i [as getSymbolDisplayPartsDocumentationAndSymbolKind] (typescriptServices.js:60)
at Object.y [as getQuickInfoAtPosition] (typescriptServices.js:63)
at e.getQuickInfoAtPosition (worker.js:9)
at t.e.fmr (workerMain.js:7)
at t._handleMessage (workerMain.js:7)
at errors.ts:84
- Consider the following code:
func({
test() {
}
})When hovering over the function test with the command key pressed (macOS), an error will be thrown:
Uncaught Error: Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at Object.r [as getDefinitionAtPosition] (typescriptServices.js:59)
at Object.v [as getDefinitionAtPosition] (typescriptServices.js:63)
at e.getDefinitionAtPosition (worker.js:9)
at t.e.fmr (workerMain.js:7)
at t._handleMessage (workerMain.js:7)
at Object.handleMessage (workerMain.js:7)
at e._handleMessage (workerMain.js:7)
at e.handleMessage (workerMain.js:7)
at t.onmessage (workerMain.js:7)
at self.onmessage (workerMain.js:7)
at Object.r [as getDefinitionAtPosition] (typescriptServices.js:59)
at Object.v [as getDefinitionAtPosition] (typescriptServices.js:63)
at e.getDefinitionAtPosition (worker.js:9)
at t.e.fmr (workerMain.js:7)
at t._handleMessage (workerMain.js:7)
at Object.handleMessage (workerMain.js:7)
at e._handleMessage (workerMain.js:7)
at e.handleMessage (workerMain.js:7)
at t.onmessage (workerMain.js:7)
at self.onmessage (workerMain.js:7)
at errors.ts:84
These errors will cause the webview to crash every time if the code is run inside a chrome webview (tested on chrome 60. nw0.24)
plz fix this.
Metadata
Metadata
Assignees
Labels
No labels
Activity
alexdima commentedon Aug 8, 2017
Kunli Deng (@dengkunli) an uncaught error should not result in a crash. Can you perhaps consult the nw documentation and see how to add a default error handler that prevents webviews from crashing.
In the meantime, I have opened microsoft/TypeScript#17683 against the TypeScript compiler, we are using version 2.3.4 in the editor.
alexdima commentedon Dec 12, 2019
This has been fixed and a new version of the editor with the fix is available