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

SyntaxError: Unexpected token ... when using cypress with webpack-preprocessor #4008

Closed
Bastczuak opened this issue May 16, 2019 · 7 comments

Comments

@Bastczuak
Copy link

Bastczuak commented May 16, 2019

Version

3.7.0

Reproduction link

https://github.com/Bastczuak/vue-cli-issue

Environment info

Environment Info:

  System:
    OS: macOS 10.14.4
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
  Binaries:
    Node: 11.14.0 - /usr/local/bin/node
    Yarn: 1.15.2 - /usr/local/bin/yarn
    npm: 6.9.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 74.0.3729.131
    Firefox: 66.0.5
    Safari: 12.1
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0
    @vue/babel-plugin-transform-vue-jsx:  1.0.0
    @vue/babel-preset-app:  3.7.0
    @vue/babel-preset-jsx:  1.0.0
    @vue/babel-sugar-functional-vue:  1.0.0
    @vue/babel-sugar-inject-h:  1.0.0
    @vue/babel-sugar-v-model:  1.0.0
    @vue/babel-sugar-v-on:  1.0.0
    @vue/cli-overlay:  3.7.0
    @vue/cli-plugin-babel: ^3.7.0 => 3.7.0
    @vue/cli-plugin-e2e-cypress: ^3.7.0 => 3.7.0
    @vue/cli-plugin-eslint: ^3.7.0 => 3.7.0
    @vue/cli-plugin-unit-jest: ^3.7.0 => 3.7.0
    @vue/cli-service: ^3.7.0 => 3.7.0
    @vue/cli-shared-utils:  3.7.0
    @vue/component-compiler-utils:  2.6.0
    @vue/eslint-config-standard: ^4.0.0 => 4.0.0
    @vue/preload-webpack-plugin:  1.1.0
    @vue/test-utils: 1.0.0-beta.29 => 1.0.0-beta.29
    @vue/web-component-wrapper:  1.2.0
    eslint-plugin-vue: ^5.0.0 => 5.2.2 (4.7.1)
    jest-serializer-vue:  2.0.2
    vue: ^2.6.10 => 2.6.10
    vue-eslint-parser:  5.0.0 (2.0.3)
    vue-hot-reload-api:  2.3.3
    vue-jest:  3.0.4
    vue-loader:  15.7.0
    vue-router: ^3.0.3 => 3.0.6
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.5.21 => 2.6.10
    vue-template-es2015-compiler:  1.9.1
    vuex: ^3.0.1 => 3.1.1
  npmGlobalPackages:
    @vue/cli: 3.7.0

Steps to reproduce

Install node modules with yarn and try to run the e2e tests with yarn test:e2e and see the error message.

What is expected?

The e2e will run with no errors.

What is actually happening?

Cypress throws an exception when trying to run e2e tests.


I'm using https://github.com/cypress-io/cypress-webpack-preprocessor for bundling my tests with webpack. It works when using @vue/cl-service in version 3.5.0.

@LinusBorg
Copy link
Member

I think Cypress uses an putdated node version internally, and we use Node >8.11 features in Vue CLI, like Object rest spread. That probably breaks it.

@Bastczuak
Copy link
Author

@LinusBorg Do you want me to open a issue on their repo then?

@cars10
Copy link

cars10 commented Jun 5, 2019

Are there any updates to this? Running cypress worked with 3.5.0 but is broken in the current version of vue-cli.

@LinusBorg
Copy link
Member

LinusBorg commented Jun 5, 2019

Cypress updated their internal node version from node 8.2.1 to node 8.9.3 in Cypress 3.3.0 (see CHANGELOG)

Upgraded node from 8.2.1 to 8.9.3. Addressed in #4001

That version was released on 5/17/2019, a day after this issue here was opened, so I assume that updating your Cypress dependency should make it work. You may have to clear your lockfile.

@LinusBorg
Copy link
Member

I'll close this assuming the new version fixed this problem.

@Bastczuak Please ping me if my assumption turns out to be incorrect.

@cars10
Copy link

cars10 commented Jun 11, 2019

@LinusBorg upgrading cypress to 3.3.0 worked, thanks.

@Bastczuak
Copy link
Author

@LinusBorg thanks mate! All good now.

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

3 participants