Skip to content
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

[Error] TypeError: Cannot read property 'text' of undefined at HelpCompletionFeature.onEvent #1230

Closed
Velocet opened this issue Mar 15, 2018 · 6 comments · Fixed by #1236
Closed
Labels

Comments

@Velocet
Copy link

Velocet commented Mar 15, 2018

System Details

  • Operating system name and version: Windows 10 Enterprise 1709 [10.0.16299.98]
  • VS Code version: 1.21.0
  • PowerShell extension version: 1.6.0
  • Output from $PSVersionTable:
Name                           Value
----                           -----
PSVersion                      5.1.16299.98
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.16299.98
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
code -v
1.21.0
9a199d77c82fcb82f39c68bb33c614af01c111ba
x64

$pseditor.EditorServicesVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
1      6      0      0


code --list-extensions --show-versions
AlanWalk.markdown-toc@1.5.6
bierner.markdown-preview-github-styles@0.1.0
christian-kohler.path-intellisense@1.4.2
DavidAnson.vscode-markdownlint@0.14.0
dbaeumer.vscode-eslint@1.4.7
DotJoshJohnson.xml@1.9.2
ecmel.vscode-html-css@0.2.0
formulahendry.auto-close-tag@0.5.6
formulahendry.auto-rename-tag@0.0.15
formulahendry.code-runner@0.9.2
HookyQR.beautify@1.3.0
KnisterPeter.vscode-github@0.27.1
mdickin.markdown-shortcuts@0.8.1
mkaufman.HTMLHint@0.4.0
mrmlnc.vscode-remark@1.1.0
ms-vscode.csharp@1.14.0
ms-vscode.github-issues-prs@0.9.0
ms-vscode.PowerShell@1.6.0
ms-vsts.team@1.122.0
msjsdiag.debugger-for-chrome@4.2.0
robertohuertasm.vscode-icons@7.21.0
Shan.code-settings-sync@2.9.0
shinnn.stylelint@0.34.2
shuworks.vscode-table-formatter@1.2.1
steve8708.Align@0.2.0
streetsidesoftware.code-spell-checker@1.6.5
streetsidesoftware.code-spell-checker-german@0.1.2
Tyriar.sort-lines@1.5.0
Zignd.html-css-class-completion@1.17.1

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.16299.98
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.16299.98
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Issue Description

When using command completion an error gets thrown inside Log (Window):

[2018-03-16 00:01:17.448] [renderer1] [error] Cannot read property 'text' of undefined: TypeError: Cannot read property 'text' of undefined
    at HelpCompletionFeature.onEvent (C:\Users\Velocet\.vscode\extensions\ms-vscode.powershell-1.6.0\src\features\HelpCompletion.ts:49:42)
    at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:88:1012)
    at e.$acceptDirtyStateChanged (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:627:178)
    at e._doInvokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:587:832)
    at e._invokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:587:550)
    at e._receiveRequest (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:586:658)
    at e._receiveOneMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:586:427)
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:585:494
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:588:343
    at c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:87:749
    at e.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:88:992)
    at Socket.<anonymous> (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\node\extensionHostProcess.js:143:227)
    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)

Example: Writing Write-Ho throws an error when pressing Tab to complete the command.

Since i dunno much about the inner workings of VS Code or TypeScript, this is just a guess: The path referenced in the error (C:\Users\Velocet\.vscode\extensions\ms-vscode.powershell-1.6.0\src\features\HelpCompletion.ts) is wrong. The file in questsion is located at C:\Users\Velocet\.vscode\extensions\ms-vscode.powershell-1.6.0\out\src\features\HelpCompletion.js and is a JavaScript file instead of a TypeScript one.

Attached Logs

1521154104-9ebabe1c-9422-485b-954d-4e8dacc678161521154100855.zip

@rjmholt
Copy link
Contributor

rjmholt commented Mar 20, 2018

I've just tried to reproduce this with Write-Ho<TAB> and couldn't, but if null is occurring there, then perhaps VSCode is sending us a bad message... With some defensive programming, we can just return when we are sent null (although perhaps we still want to log an error there...).

@Velocet TypeScript compiles to JavaScript. So you're quite right that the error is occurring in ...\HelpCompletion.js, but that's under the out directory -- JavaScript here is like the binary output of TypeScript. Pre-compilation it's here

@rjmholt
Copy link
Contributor

rjmholt commented Mar 20, 2018

Also, thanks for opening an issue!

@rkeithhill
Copy link
Contributor

I have seen it before in the dev tools window. Let me see if I can repro it.

@Velocet
Copy link
Author

Velocet commented Mar 21, 2018

@rjmholt Thanks for clarification! 👍

Is there anything i can do to help? Maybe a detailed trace or something alike?

@rjmholt
Copy link
Contributor

rjmholt commented Mar 21, 2018

If you could provide something like that, it would definitely be helpful. The issue as it appears now seems trivial to fix, but I can't reproduce it and VSCode really shouldn't be sending us null messages, which makes me wonder if something stranger is going on

@rjmholt
Copy link
Contributor

rjmholt commented Mar 21, 2018

Actually, I see above that you've already got a trace. My inclination is to just fix the superficial bug and see if bad things persist -- we lose nothing by being defensive. I will open a PR tonight

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants