-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Webpack Compilation Error: Cannot find module - Babel dependency when .babelrc
defines plugins
#8364
Comments
Can you provide any of the code you have included for preprocessing? The plugins/index.js, package.json, support files, etc? Thanks! |
I've had the same issue. I've not been able to repo on a freash install... it happens when I upgrade from 4.3 to 5.0 within an existing angular project that uses webpack (4.43.0) and typescript (3.5.3). I suspect there is some conflict between my projects webpack/typescript install or config and what cypress is using. I'm using the following cypress plugins:
I had suspected it was related to #7503... which has been closed as fixed. |
@tyagow Do you happen to have a |
@jennifer-shehane Adding a {
"presets": [
],
"plugins": [
"transform-runtime"
],
"comments": true,
"sourceMaps": true
} |
I'm able to recreate this with the presence of the
{
"plugins": [
"transform-runtime"
]
} Run 4.12.15.0.0 |
.babelrc
defines plugins
adding an empty
|
Thank you for sharing, I will give 5.0 another shot |
I have the same error while running with {
"plugins": ["styled-components", "transform-decorators"],
"presets": [
[
"env",
{
"modules": false,
"targets": {
"browsers": ["last 2 versions", "> 0.5% in BR", "iOS >= 9.3"]
},
"useBuiltIns": "entry"
}
],
"react",
"stage-0"
],
"env": {
"development": {
"plugins": ["babel-plugin-styled-components"]
},
"production": {
"plugins": [
"transform-react-remove-prop-types",
"transform-react-constant-elements",
"transform-react-inline-elements",
"syntax-dynamic-import"
]
},
"test": {
"presets": ["env", "react"],
"plugins": [
"transform-es2015-modules-commonjs",
"transform-class-properties",
"dynamic-import-node",
"syntax-dynamic-import"
]
}
}
} Adding an empty Dependencies:
Any idea on how to work around this issue? |
I tried the same but its still not working for me. Any other option ? |
I managed to get Cypress working by adding .babelrc in the Cypress directory and using this package: https://www.npmjs.com/package/@cypress/webpack-preprocessor#use-babelrc |
Changing from |
Adding an empty .babelrc in cypress/.babelrc didnt help me...can some one help me out with a working solution for this ?
|
@jennifer-shehane We are experiencing the same issue with the latest Cypress version and it's currently a blocker for our testing. Please provide a workaround or some additional info on how can we run our tests. |
Worked for me either , thanks "cypress": "^5.5.0", |
I tried with |
Share your dependencies please! |
I found this for babel: |
Hey Guys, I have this problem and I've tried to add {cypress/.babelrc} inside the cypress.json file. Should I write something else??? |
Hey! You should add the file to |
Thankss laurogripa!
Thank you!! |
Thanks for your sharing, it works for me. "cypress": "^6.6.0" |
I have the same issue and I can't get this working right now. I've installed the dependencies mentioned on this ticket and also the .bashrc file, but no joy. I will downgrade to the 6.6.0 version and see if that works for me.
This is just using the hello world example. Some further logs:
|
Downgrading to 6.9.1 did not work will fix to 6.6.0 and see what happens. UPDATE: 6.6.0 fails with the same error. Can I get more information to the authors?? What more items can I try, any further logging you need, this seems to be very much of the "one line error" variety. More help needed. UPDATE: browserlist => .browserlistsrc worked for me. Perhaps a empty one could be created if cypress doesn't find the file. |
Adding .babelrc didn't work for me. But my problem was with a .css file |
I'm having the same issue. I used the empty Initially it was all babel errors. (ie. Cypress Version: 7.4.0
And the current error that I'm getting:
I'm also using create react app and would really prefer not to eject if possible. The empty babelrc file worked for so long, I don't understand what I've done in the meantime that changed that. Edit: I have found the source of it. In my tests I imported 3 const strings to test with. These were from source files and were are used as URL params, so I thought importing them was a good idea. Turns out that by importing the strings, it |
I have the same issue width Cypress v7.3.0. And it has no effect that adding I have a .babelrc file in project root dir with content as below:
|
The code for this is done in cypress-io/cypress#16980, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior:
The test doesn't start and an error message is displayed
Desired behavior:
Test work as they were in version 4.12
Test code to reproduce
?
Versions
Cypress 5.0
Ubuntu 20.04
The text was updated successfully, but these errors were encountered: