Closed capaj closed 5 years ago
@capaj Wow ! first of all, thanks for the PR and the issue! Can you please post the snippet you've tried to refactor? Thanks!
I actually get this error whenever I focus any code at all. It doesn't even have to be a stateless component. I got it even with a bash script, with html template, with whatever you can think of.
I see. Does it happen when you select a valid component though? If so, can u post a snippet?
Getting this problem as well. Downgraded to 4.2.2 just to to see if an older version helps. It gives the same error so I think it might either be a problem with a new VSCode update or a conflicting extension.
Also getting this error with VSCode 1.32.3
during app startup / initial extension activation. Using TypeScript. Glean doesn't appear to load at all, at least the commands aren't available.
[2019-03-29 12:43:36.449] [exthost] [error] [wix.glean] provider FAILED
[2019-03-29 12:43:36.450] [exthost] [error] TypeError: Cannot read property 'superClass' of undefined
at isSupportedComponent (/Users/petepetrash/.vscode/extensions/wix.glean-4.10.1/out/modules/stateful-to-stateless.js:303:28)
at Object.isStatefulComp (/Users/petepetrash/.vscode/extensions/wix.glean-4.10.1/out/modules/stateful-to-stateless.js:310:9)
at CompleteActionProvider.provideCodeActions (/Users/petepetrash/.vscode/extensions/wix.glean-4.10.1/out/extension.js:39:37)
at define.provideCodeActions.a.asPromise (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:564:641)
at t.asPromise.Promise (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:48:58)
at new Promise (<anonymous>)
at Object.t.asPromise (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:48:32)
at I.provideCodeActions (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:564:612)
at define.$provideCodeActions._withAdapter.e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:580:417)
at $._withAdapter (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:575:502)
at $provideCodeActions (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:580:395)
at h._doInvokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:593:118)
at h._invokeHandler (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:592:777)
at h._receiveRequest (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:591:383)
at h._receiveOneMessage (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:590:279)
at define.constructor._protocol.onMessage.e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:588:565)
at u.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:43:254)
at e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:39:64)
at u.fire (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:43:254)
at s (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:168:754)
at Socket.define.constructor._socketDataListener.e (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:168:960)
at Socket.emit (events.js:182:13)
at Socket.EventEmitter.emit (domain.js:442:20)
at addChunk (_stream_readable.js:279:12)
at readableAddChunk (_stream_readable.js:264:11)
at Socket.Readable.push (_stream_readable.js:219:10)
at Pipe.onread (net.js:636:20)
[2019-03-29 12:43:36.725] [exthost] [info] ExtensionService#_doActivateExtension vscode.extension-editing {"startup":false,"activationEvent":"onLanguage:typescript"}
[2019-03-29 12:43:36.725] [exthost] [info] ExtensionService#loadCommonJSModule /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/extension-editing/dist/extension
Hey @petekp , can you post the snipper u've tried refactoring?
@borislit I'm unable to use the plugin — the commands aren't accessible / don't show up since the plugin doesn't appear to load when my extensions are activated.
@petekp hmmm odd. Can you post the React snipper u've tried to refactor?
Having the same issue here on React memo's
const Rows = memo(({ customer }) => { return <span>some layout stuff</span> }
[renderer1] [error] Cannot read property 'superClass' of undefined: TypeError: Cannot read property 'superClass' of undefined
@timcluyts You are getting this error when You select the snippet?
@borislit When I put my cursor on memo, but even when I just open the file itself. Additionally I get following error too:
[2019-04-09 10:25:57.544] [exthost] [error] TypeError: Cannot read property 'selection' of undefined at Object.selectedText (c:\Users\****\.vscode\extensions\wix.glean-4.10.1\out\editor.js:37:30) at CompleteActionProvider.provideCodeActions (c:\Users\****\.vscode\extensions\wix.glean-4.10.1\out\extension.js:17:31) at define.provideCodeActions.a.asPromise (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:587:847) at t.asPromise.Promise (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:49:430) at new Promise (<anonymous>)
This is just on top of the superclass of undefined
@timcluyts Ok, I can reproduce! The fix is on its way :)
:tada: This issue has been resolved in version 4.10.2 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
@timcluyts can you verify the issue is resolved? Also, full credit for the fix goes to @capaj ! My bad I haven't merged this earlier!
@timcluyts BTW, What refactoring did you try to perform on the memo component? Perhaps its something we should support
The issue on "superclass" has indeed been resolved. But - if you open the output window (Extension host) - and go to a memo class and put your cursor on "memo" it will still give the following:
For that last question, the thing is that I did not in fact try to refactor. It just ended up in de output window when opening the file or selecting the memo itself. I only actually stumbled upon this issue because I was fighting with another one of my extensions and then, when enabling only Glean, I noticed these issues.
I just created a fix for the issue described above.
@borislit any chance of merging it? I am having to disable Glean because of these issues.
@timcluyts Sure. Ill review and merge right away
@timcluyts Done! Thanks for your contribution!
https://github.com/wix/vscode-glean/blob/7d6791f9595bb9be4e5619f566c7c67276599d87/src/modules/jsx.ts#L166
I think that line needs another guard because I am seeing:
The code I am looking at is just a simple stateless component.
Version 4.2.3