Skip to content

[ Critical Bug ] throws error / crash when hovering over function names under specific conditions #537

Closed

Description

@dengkunli

Two cases that can 100% reproduce (both on the monaco website and other places):

  1. 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
  1. 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.

Activity

  1. alexdima commented on Aug 8, 2017

    @alexdima
    Member

    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.

  2. alexdima commented on Dec 12, 2019

    @alexdima
    Member

    This has been fixed and a new version of the editor with the fix is available

  3. locked and limited conversation to collaborators on Jan 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions