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

Cannot run example specs - Webpack Compilation Error #8523

Closed
aplaskota opened this issue Sep 8, 2020 · 19 comments
Closed

Cannot run example specs - Webpack Compilation Error #8523

aplaskota opened this issue Sep 8, 2020 · 19 comments

Comments

@aplaskota
Copy link

aplaskota commented Sep 8, 2020

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)

@nelsongustavo
Copy link

nelsongustavo commented Sep 22, 2020

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.

@havenchyk
Copy link

Might be a duplication of #8364

@jennifer-shehane
Copy link
Member

@aplaskota @nelsongustavo Is this failing with the example specs that are seeding within your project? Or is this happening in the example specs after cloning the https://github.com/cypress-io/cypress-example-kitchensink repo directly?

If it's within your own project, do you have a .babelrc file present in the project? Because it may be a duplicate of #8364 or some other issue. Please provide the contents of this file or any other configuration from you project. Thanks!

@jennifer-shehane jennifer-shehane added the stage: needs information Not enough info to reproduce the issue label Oct 9, 2020
@jjalonso
Copy link

jjalonso commented Nov 20, 2020

just happened to me,on my project: yarn add cypress, yarn run cypress open, clicking any spec will show that error.

Error: Webpack Compilation Error
./cypress/integration/examples/cookies.spec.js
Module build failed (from /Users/jjalonso/Library/Caches/Cypress/5.6.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/babel-loader/lib/index.js):
Error: Multiple configuration files found. Please remove one:
 - package.json
 - /Users/jjalonso/Work/showcode-app/.babelrc
from /Users/jjalonso/Work/showcode-app

@jennifer-shehane
Copy link
Member

@jjalonso Can you provide a repo that we can run to reproduce this error?

@jjalonso
Copy link

jjalonso commented Nov 20, 2020 via email

@sarimarton
Copy link

sarimarton commented Dec 3, 2020

This, or something similar is happening to me:

Error: Webpack Compilation Error
./cypress/integration/examples/actions.spec.js
Module build failed (from /Users/marton.sari/Library/Caches/Cypress/6.0.1/Cypress.app/Contents/Resources/app/packages/server/node_modules/babel-loader/lib/index.js):
Error: Plugin/Preset files are not allowed to export objects, only functions. In /Users/marton.sari/***(project path)***/node_modules/babel-preset-es2015/lib/index.js

MacOS@10.15.7
Cypress@6.0.1

It works in an empty repo, but I can't share the one I'm using it in.

@s4l4x
Copy link

s4l4x commented Dec 28, 2020

Same issue here in a private repo:

"cypress": "^6.2.0",

./cypress/integration/sample_spec.js
Module build failed (from /Users/s4l4x/Library/Caches/Cypress/6.2.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/babel-loader/lib/index.js):
Error: Plugin/Preset files are not allowed to export objects, only functions. In .../node_modules/babel-preset-react/lib/index.js```

@jennifer-shehane
Copy link
Member

Can anyone provide a reproducible example? Here are some tips for providing a Short, Self Contained, Correct, Example and our own Troubleshooting Cypress guide.

@nelsongustavo
Copy link

@aplaskota @nelsongustavo Is this failing with the example specs that are seeding within your project? Or is this happening in the example specs after cloning the https://github.com/cypress-io/cypress-example-kitchensink repo directly?

If it's within your own project, do you have a .babelrc file present in the project? Because it may be a duplicate of #8364 or some other issue. Please provide the contents of this file or any other configuration from you project. Thanks!

Can anyone provide a reproducible example? Here are some tips for providing a Short, Self Contained, Correct, Example and our own Troubleshooting Cypress guide.

Hey guys, it was my .babelrc file...
image

I was able to fix with this modification...

@jennifer-shehane
Copy link
Member

Duplicate of #8364

@jennifer-shehane jennifer-shehane marked this as a duplicate of #8364 Jan 12, 2021
@jennifer-shehane jennifer-shehane removed the stage: needs information Not enough info to reproduce the issue label Jan 12, 2021
@AdinaFakih
Copy link

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

@MartaSwieboda
Copy link

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.

@pratikraut840
Copy link

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

@sumayya86
Copy link

@pratikraut840 this solution is perfect. works for me

@testingy12345
Copy link

Error: Webpack Compilation Error
./cypress/e2e/PageObjectModel.cy.js
Module not found: Error: Can't resolve '../PageObject/LoginPage.js' in 'C:\Users\Dell\CypressAutomation\cypress\e2e'
Looked for and couldn't find the file at the following paths:
[C:\Users\Dell\CypressAutomation\cypress\PageObject\LoginPage.js]
[C:\Users\Dell\CypressAutomation\cypress\PageObject\LoginPage.js.js]
[C:\Users\Dell\CypressAutomation\cypress\PageObject\LoginPage.js.json]
[C:\Users\Dell\CypressAutomation\cypress\PageObject\LoginPage.js.jsx]
[C:\Users\Dell\CypressAutomation\cypress\PageObject\LoginPage.js.mjs]
[C:\Users\Dell\CypressAutomation\cypress\PageObject\LoginPage.js.coffee]
@ ./cypress/e2e/PageObjectModel.cy.js 3:17-54

@AtofStryker
Copy link
Contributor

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

@testingy12345
Copy link

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

The issue is resolved in today afternoon.

@prios-mbenyakoub
Copy link

@testingy12345 how did you resolve the issue ?

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