SyntaxError: Unexpected token ... when using cypress with webpack-preprocessor
See original GitHub issueVersion
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.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Fix Cypress “Invalid or unexpected token” errors in parallel runs
Solution to fix Cypress “Invalid or unexpected token” errors when running Cypress in parallel mode.
Read more >Cypress Cucumber ^ ParseError: Unexpected token
It seems you are mixing regex steps and plain string type placeholders. You have 2 possible options: Write definition with regex: And(/^I ...
Read more >Preprocessors API - Cypress Documentation
A preprocessor is the plugin responsible for preparing a support file or a test file ... If you don't use webpack in your...
Read more >cypress-io/cypress - Gitter
on('file:preprocessor', wp(options));. How can I use more plugins with webpack, e.g: require('cypress-plugin-retries/lib/plugin')(on);
Read more >@cypress/webpack-preprocessor - npm
Cypress preprocessor for bundling JavaScript via webpack. Latest version: 5.16.0, last published: 9 days ago. Start using ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Cypress updated their internal node version from node 8.2.1 to node 8.9.3 in Cypress
3.3.0
(see CHANGELOG)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 thanks mate! All good now.