Vscode-spell-checker: Lots of Cannot read property 'document' of undefined

Created on 21 Oct 2016  路  6Comments  路  Source: streetsidesoftware/vscode-spell-checker

I've been seeing lots of these errors in the console lately:

Cannot read property 'document' of undefined: TypeError: Cannot read property 'document' of undefined
    at updateStatusBarWithSpellCheckStatus (/Users/eric/.vscode-insiders/extensions/streetsidesoftware.code-spell-checker-0.11.3/out/src/extension.js:97:38)
    at onDidChangeActiveTextEditor (/Users/eric/.vscode-insiders/extensions/streetsidesoftware.code-spell-checker-0.11.3/out/src/extension.js:133:13)
    at e.invoke (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:5:5933)
    at e.fire (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:5:14255)
    at t.$acceptActiveEditorAndVisibleEditors (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:11:11978)
    at t.e.handle (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:10:10407)
    at s (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:7:19887)
    at p (/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/node/extensionHostProcess.js:7:20564)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
e.onUnexpectedError @   //Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.main.js:125

I think a guard should be added here https://github.com/Jason-Rev/vscode-spell-checker/blob/master/client/src/extension.ts#L121

Done / Fixed bug

All 6 comments

Thank you. I'll take care of it.

Fixed in 0.11.4

This seems to still seems to happen.
Steps to reproduce for me:

  • open vscode on a folder,
  • open files on two editor group,
  • select the file on the right editor group,
  • click on the cSpell area on the status bar

The stack trace:

messageService.ts:126 Unable to open 'Spell Checker Info': Cannot read property 'document' of undefined.: Error: Unable to open 'Spell Checker Info': Cannot read property 'document' of undefined.
    at t.doHandleSetInputError (file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:29:367915)
    at file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:29:367521
    at Object.v [as _notify] (file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:50893)
    at Object.enter (file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:54394)
    at _run (file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:55715)
    at _error (file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:55232)
    at file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:64923
    at done (file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:56274)
    at Object.v [as _notify] (file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:51066)
    at Object.enter (file:///C:/Program Files (x86)/Microsoft VS Code/resources/app/out/vs/workbench/electron-browser/workbench.main.js:28:54394)
    e.doShow @ messageService.ts:126
    e.show @ messageService.ts:105
    t.doHandleSetInputError @ editorPart.ts:525
    (anonymous function) @ editorPart.ts:505
    v @ winjs.base.raw.js:1209
    enter @ winjs.base.raw.js:901
    _run @ winjs.base.raw.js:1068
    _error @ winjs.base.raw.js:1041
    (anonymous function) @ async.ts:360
    done @ winjs.base.raw.js:1378
    v @ winjs.base.raw.js:1224
    enter @ winjs.base.raw.js:901
    _run @ winjs.base.raw.js:1068
    _chainedError @ winjs.base.raw.js:1031
    n @ winjs.base.raw.js:736
    then @ winjs.base.raw.js:1436
    enter @ winjs.base.raw.js:747
    _run @ winjs.base.raw.js:1068
    _setCompleteValue @ winjs.base.raw.js:1052
    v @ winjs.base.raw.js:1209
    enter @ winjs.base.raw.js:901
    _run @ winjs.base.raw.js:1068
    _error @ winjs.base.raw.js:1041
    e.resolveErr @ ipcRemoteCom.ts:111
    f @ ipcRemoteCom.ts:203
    _combinedTickCallback @ internal/process/next_tick.js:67
    _tickCallback @ internal/process/next_tick.js:98
index.js:36 [uncaught exception]: TypeError: Cannot read property 'document' of undefined
    onError @ index.js:36
    (anonymous function) @ index.js:105
    emitOne @ events.js:96
    emit @ events.js:188
    window.onerror @ C:\Program Files (x86)\Microsoft VS Code\resources\electron.asar\renderer\init.js:120
    i.globals.onerror @ errorTelemetry.ts:64
index.js:39 TypeError: Cannot read property 'document' of undefined
    at CSpellInfoTextDocumentContentProvider.createInfoHtml (C:\Users\Federico\.vscode\extensions\streetsidesoftware.code-spell-checker-1.0.2\out\src\cSpellInfo.js:44:36)
    at CSpellInfoTextDocumentContentProvider.provideTextDocumentContent (C:\Users\Federico\.vscode\extensions\streetsidesoftware.code-spell-checker-1.0.2\out\src\cSpellInfo.js:35:25)
    at c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:307559
    at c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:58869
    at new n.Class.derive._oncancel (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:54918)
    at Object.p [as asWinJsPromise] (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:58832)
    at t.$provideTextDocumentContent (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:307523)
    at t.e.handle (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:277319)
    at s (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:135077)
    at h (c:\Program Files (x86)\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:4:135754)onError @ index.js:39(anonymous function) @ index.js:105emitOne @ events.js:96emit @ events.js:188window.onerror @ C:\Program Files (x86)\Microsoft VS Code\resources\electron.asar\renderer\init.js:120i.globals.onerror @ errorTelemetry.ts:64
ipcRemoteCom.ts:198 Uncaught TypeError: Cannot read property 'document' of undefined
    f @ ipcRemoteCom.ts:198
    _combinedTickCallback @ internal/process/next_tick.js:67
    _tickCallback @ internal/process/next_tick.js:98

Let me know if you prefer if I open a new issue

Thank you. Please open a new issue. These are unrelated.

Thank you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fgarcia picture fgarcia  路  3Comments

solidpixel picture solidpixel  路  5Comments

jose-a-sa picture jose-a-sa  路  6Comments

gandalfsaxe picture gandalfsaxe  路  5Comments

Deilan picture Deilan  路  3Comments