Giter Club home page Giter Club logo

Comments (7)

borislit avatar borislit commented on May 15, 2024 2

@calebeby i was able to reproduce the issue. WIll handle ASAP

from vscode-glean.

borislit avatar borislit commented on May 15, 2024

@calebeby can you provide the exact JSX string you wanted to extract? thanks

from vscode-glean.

calebeby avatar calebeby commented on May 15, 2024

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.

borislit avatar borislit commented on May 15, 2024

@calebeby issue resolved. Please update to the latest version. Ping me if you have any more issues :)

from vscode-glean.

maxkomarychev avatar maxkomarychev commented on May 15, 2024

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.

borislit avatar borislit commented on May 15, 2024

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.

maxkomarychev avatar maxkomarychev commented on May 15, 2024

@borislit

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.