cypress: Cannot run example specs - Webpack Compilation Error

Current behavior:

I cannot open any example tests. Each try generates the same error

Error: Webpack Compilation Error
./cypress/integration/examples/aliasing.spec.js

Module build failed (from C:/user_path/Cypress/Cache/5.1.0/Cypress/resources/app/packages/server/node_modules/babel-loader/lib/index.js):

Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' option, whose value must be a boolean. If you are migrating from Babylon/Babel 6 or want to use the old decorators proposal, you should use the 'decorators-legacy' plugin instead of 'decorators'.

Desired behavior:

Example tests should be run and working after Cypress installation

Test code to reproduce

  • Instll Cypress (npm install cypress --save-dev)
  • Open desktop app (npx cypress open)
  • Pick up one of the existing example tests

Versions

Node 10.22.0 npm 6.14.6 Cypress 5.1.0 Windows 10 Chrome 85.0.4183.83 (Official Build) (64-bit)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 12
  • Comments: 19 (5 by maintainers)

Most upvoted comments

Webpack Compilation Error
./cypress/support/index.js
Module build failed (from /Users/gustavop/Library/Caches/Cypress/5.2.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/babel-loader/lib/index.js):
Error: Cannot find module 'babel-plugin-transform-class-properties' from '/Users/gustavop/code/sst-digital'
Webpack Compilation Error
./cypress/integration/examples/actions.spec.js
Module build failed (from /Users/gustavop/Library/Caches/Cypress/5.2.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/babel-loader/lib/index.js):
Error: Cannot find module 'babel-plugin-transform-class-properties' from '/Users/gustavop/code/sst-digital'

Same here.

Just delete the last two folders i.e. Plugings & supports and see the magic

@testingy12345 are you able to file a separate issue with a reproduction that we can run to recreate the issue?

const { should } = require(“chai”)

Remove the above line from your code, this line maybe on top of you commands.js file This will fix the error for me

this line “const { should } = require(“chai”)” has appear somehow in my spec.js file on the top. I have remove it and it’s working.

const { should } = require(“chai”)

Remove the above line from your code, this line maybe on top of you commands.js file This will fix the error for me