Skip to content

Unexpected token when running vue add #24

Open
@gnuletik

Description

@gnuletik

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...

+ vue-cli-plugin-vue-next@0.1.2
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 :)

Activity

changed the title [-]Unexpected token when on vue add[/-] [+]Unexpected token when running vue add[/+] on Apr 22, 2020
lmiller1990

lmiller1990 commented on May 22, 2020

@lmiller1990
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

eni9889 commented on Jun 7, 2020

@eni9889

Same for me as well.

VottusCode

VottusCode commented on Aug 26, 2020

@VottusCode

I have the exact same issue.

My current dependencies:
image

Output:
image

haoqunjiang

haoqunjiang commented on Aug 27, 2020

@haoqunjiang
Member

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

VottusCode

VottusCode commented on Aug 31, 2020

@VottusCode

@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

lmiller1990 commented on Aug 31, 2020

@lmiller1990
Member

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @eni9889@haoqunjiang@gnuletik@lmiller1990@VottusCode

        Issue actions

          Unexpected token when running vue add · Issue #24 · vuejs/vue-cli-plugin-vue-next