Comments (7)
@calebeby i was able to reproduce the issue. WIll handle ASAP
from vscode-glean.
@calebeby can you provide the exact JSX string you wanted to extract? thanks
from vscode-glean.
I think it gives me this error no matter what I try to extract, one thing I tried was <div>Hi</div>
.
By the way, I am using VS Code Insiders, which might be the problem?
from vscode-glean.
@calebeby issue resolved. Please update to the latest version. Ping me if you have any more issues :)
from vscode-glean.
I have the same issue as well. It first happened to me when I tried to apply "Convert Stateful to Stateless Component", but it seems to he happening for any refactoring I'm trying to apply.
glean: 4.9.0.
vscode: Version 1.32.1 (1.32.1)
Sample code:
class Test extends PureComponent {
render() {
return <TextInput />
}
}
The log I captured in "Output" tab:
[2019-03-13 09:06:26.638] [exthost] [error] [wix.glean] provider FAILED
[2019-03-13 09:06:26.639] [exthost] [error] SyntaxError: Unexpected token, expected ";" (2:13)
1 | /* @babel/template */;
> 2 | render() {
| ^
3 | return <TextInput />
4 | }
5 | }
at _class.raise (~/.vscode/extensions/wix.glean-4.9.0/node_modules/@babel/parser/lib/index.js:3939:15)
at _class.unexpected (~/.vscode/extensions/wix.glean-4.9.0/node_modules/@babel/parser/lib/index.js:5248:16)
at _class.semicolon (~/.vscode/extensions/wix.glean-4.9.0/node_modules/@babel/parser/lib/index.js:5232:40)
at _class.parseExpressionStatement (~/.vscode/extensions/wix.glean-4.9.0/node_modules/@babel/parser/lib/index.js:7665:10)
at _class.parseExpressionStatement (~/.vscode/extensions/wix.glean-4.9.0/node_modules/@babel/parser/lib/index.js:9980:69)
at _class.parseStatementContent (~/.vscode/extensions/wix.glean-4.9.0/node_modules/@babel/parser/lib/index.js:7264:19)
at _class.parseStatementContent (~/.vscode/extensions/wix.glean-4.9.0/node_modules/@babel/parser/lib/index.js:9916:58)
at _class.parseStatement (~/.vscode/extensions/wix.glean-4.9.0/node_modules/@babel/parser/lib/index.js:7145:17)
at _class.parseBlockOrModuleBlockBody (~/.vscode/extensions/wix.glean-4.9.0/node_modules/@babel/parser/lib/index.js:7696:23)
at _class.parseBlockBody (~/.vscode/extensions/wix.glean-4.9.0/node_modules/@babel/parser/lib/index.js:7683:10)
at _class.parseTopLevel (~/.vscode/extensions/wix.glean-4.9.0/node_modules/@babel/parser/lib/index.js:7110:10)
at _class.parse (~/.vscode/extensions/wix.glean-4.9.0/node_modules/@babel/parser/lib/index.js:8510:17)
at parse (~/.vscode/extensions/wix.glean-4.9.0/node_modules/@babel/parser/lib/index.js:10465:38)
at parseWithCodeFrame (~/.vscode/extensions/wix.glean-4.9.0/node_modules/@babel/template/lib/parse.js:145:32)
at parseAndBuildMetadata (~/.vscode/extensions/wix.glean-4.9.0/node_modules/@babel/template/lib/parse.js:43:15)
at arg (~/.vscode/extensions/wix.glean-4.9.0/node_modules/@babel/template/lib/string.js:21:50)
at Function.ast (~/.vscode/extensions/wix.glean-4.9.0/node_modules/@babel/template/lib/builder.js:47:155)
at Object.exports.templateToAst.code [as templateToAst] (~/.vscode/extensions/wix.glean-4.9.0/out/parsing.js:22:52)
at Object.isStatelessComp (~/.vscode/extensions/wix.glean-4.9.0/out/modules/statless-to-stateful.js:20:27)
at CompleteActionProvider.provideCodeActions (~/.vscode/extensions/wix.glean-4.9.0/out/extension.js:30:36)
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 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)
from vscode-glean.
Hey @maxkomarychev! Can you please try and follow the instructions in the error SyntaxError: Unexpected token, expected ";" (2:13)
and add ;
at the end of your JSX and try to run the refactoring again?
Perhaps I need to improve error messages if the syntax is invalid. Care for PR? I can point you in the right directions
from vscode-glean.
Can you please try and follow the instructions in the error SyntaxError: Unexpected token, expected ";" (2:13) and add ; at the end of your JSX and try to run the refactoring again?
I'm not sure I really follow here but I tried semicolons wherever it would make sense (although style guide in project I'm working on forbids semicolons altogether) and it didn't help.
The piece of code in logs is not my original code, it comes from some other place.
update 1
it comes from some other place.
I meant that "babel template" thing..
from vscode-glean.
Related Issues (20)
- Can't find this extension in VS Code HOT 4
- Cannot read property `tsAction` of undefined
- Extreme Latency & High Profile Usage HOT 3
- npm install command not working after cloning repo
- Extract to arrow function by default? HOT 1
- Settings: Extract to jsx file instead of tsx
- React Native error: [BABEL] unknown: Preset /* your preset */ requires a filename to be set when babel is called directly. HOT 1
- Extension issue
- Extension issue
- No props validation for Typescript users?
- Extension issue HOT 1
- useEffect refactoring suggestion is overzealous
- When converting from class to function components, useCallback doesn't convert the parameters
- Publish plugin to openVSX
- Prettier cannot run on save HOT 1
- "You must pass a scope and parentPath unless traversing a Program/File. Instead of that you tried to traverse a Identifier node without passing scope and parentPath." Error when converting class to functional component.
- This experimental syntax requires enabling the parser plugin: 'nullishCoalescingOperator' (6:77) HOT 1
- Using Extract Component to File in Client component in NextJS13 breaks it
- Takes too long to save files HOT 1
- Incorrect type. Expected one of string in setting.json
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-glean.