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

Unexpected token when running vue add #24

Open
gnuletik opened this issue Apr 21, 2020 · 6 comments
Open

Unexpected token when running vue add #24

gnuletik opened this issue Apr 21, 2020 · 6 comments

Comments

@gnuletik
Copy link

gnuletik commented Apr 21, 2020

Hi !
I'm currently unable to add the plugin to a project built with @vue/composition-api and typescript.

I get the following error after running vue add:

 ERROR  SyntaxError: Unexpected token, expected "]" (23:19)
$ vue -V
@vue/cli 4.3.1

$ vue add vue-next
📦  Installing vue-cli-plugin-vue-next...

+ [email protected]
updated 1 package and audited 949810 packages in 14.564s

92 packages are looking for funding
  run `npm fund` for details

found 624 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
✔  Successfully installed plugin: vue-cli-plugin-vue-next


🚀  Invoking generator for vue-cli-plugin-vue-next...
 ERROR  SyntaxError: Unexpected token, expected "]" (23:19)
SyntaxError: Unexpected token, expected "]" (23:19)
    at Object._raise (/home/letik/.node_modules/lib/node_modules/@vue/cli/node_modules/@babel/parser/lib/index.js:742:17)
    at Object.raiseWithData (/home/letik/.node_modules/lib/node_modules/@vue/cli/node_modules/@babel/parser/lib/index.js:735:17)
    at Object.raise (/home/letik/.node_modules/lib/node_modules/@vue/cli/node_modules/@babel/parser/lib/index.js:729:17)
    at Object.unexpected (/home/letik/.node_modules/lib/node_modules/@vue/cli/node_modules/@babel/parser/lib/index.js:8757:16)
    at Object.expect (/home/letik/.node_modules/lib/node_modules/@vue/cli/node_modules/@babel/parser/lib/index.js:8743:28)
    at Object.parsePropertyName (/home/letik/.node_modules/lib/node_modules/@vue/cli/node_modules/@babel/parser/lib/index.js:10546:12)
    at Object.parsePropertyName (/home/letik/.node_modules/lib/node_modules/@vue/cli/node_modules/@babel/parser/lib/index.js:3022:23)
    at Object.parseObjectMember (/home/letik/.node_modules/lib/node_modules/@vue/cli/node_modules/@babel/parser/lib/index.js:10451:10)
    at Object.parseObj (/home/letik/.node_modules/lib/node_modules/@vue/cli/node_modules/@babel/parser/lib/index.js:10374:25)
    at Object.parseExprAtom (/home/letik/.node_modules/lib/node_modules/@vue/cli/node_modules/@babel/parser/lib/index.js:9995:28)

Here's the reproduction repo :
https://github.com/Ircam-Web/timeside-player/tree/7b3e110a1d7839e3a721953a0a08876c7f290fdd

Is it somehow related to Typescript ? I know it is not supported yet but I've seen it can be run in the following issue #7

Thanks for this tool :)

@gnuletik gnuletik changed the title Unexpected token when on vue add Unexpected token when running vue add Apr 22, 2020
@lmiller1990
Copy link
Member

Me too:


🚀  Invoking generator for vue-cli-plugin-vue-next...
 ERROR  SyntaxError: Unexpected token (9:2)
SyntaxError: Unexpected token (9:2)
    at Object.raise (/Users/lachlan/.config/yarn/global/node_modules/@babel/parser/lib/index.js:6344:17)
    at Object.unexpected (/Users/lachlan/.config/yarn/global/node_modules/@babel/parser/lib/index.js:7659:16)
    at Object.flowObjectTypeSemicolon (/Users/lachlan/.config/yarn/global/node_modules/@babel/parser/lib/index.js:1584:12)
    at Object.flowParseObjectType (/Users/lachlan/.config/yarn/global/node_modules/@babel/parser/lib/index.js:1478:12)
    at Object.flowParseInterfaceish (/Users/lachlan/.config/yarn/global/node_modules/@babel/parser/lib/index.js:1087:22)
    at Object.flowParseInterface (/Users/lachlan/.config/yarn/global/node_modules/@babel/parser/lib/index.js:1110:10)
    at Object.parseExportDeclaration (/Users/lachlan/.config/yarn/global/node_modules/@babel/parser/lib/index.js:2257:19)
    at Object.maybeParseExportDeclaration (/Users/lachlan/.config/yarn/global/node_modules/@babel/parser/lib/index.js:10930:31)
    at Object.parseExport (/Users/lachlan/.config/yarn/global/node_modules/@babel/parser/lib/index.js:10859:29)
    at Object.parseExport (/Users/lachlan/.config/yarn/global/node_modules/@babel/parser/lib/index.js:2226:24)

@eni9889
Copy link

eni9889 commented Jun 7, 2020

Same for me as well.

@VottusCode
Copy link

VottusCode commented Aug 26, 2020

I have the exact same issue.

My current dependencies:
image

Output:
image

@haoqunjiang
Copy link
Member

@VottusCode With Vue CLI 4.5, you don't need this plugin anymore.

@VottusCode
Copy link

VottusCode commented Aug 31, 2020

@VottusCode With Vue CLI 4.5, you don't need this plugin anymore.

I wanted to update an existing application to Vue 3.
Nevermind that, even with Vue CLI 4.5, with vue create it still installs Vue 2.6.12 without the option to use Vue 3.

And yes, I do have the latest version of Vue CLI globally installed.
image

@lmiller1990
Copy link
Member

lmiller1990 commented Aug 31, 2020

I have the Vue 3 option with 4.5.0 ("choose vue version")

image

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

No branches or pull requests

5 participants