-
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
babel.config.js file not working in v8 #17411
Comments
This change was likely introduced in 7.6.0, maybe with this change: #16980 Can you confirm this is failing in 7.6.0? |
Yes, you're right, it also fails with version 7.6.0, and was working with 7.5.0. Now that I see that it was an intentional change, exists any other alternative to support custom babel configuration to preprocess spec and support files, or do you have planned to support it again? I think that using Thank you very much, please let me know if I can help any way |
If you need to load the custom config, you can use our preprocessor API to pass through those options. https://on.cypress.io/preprocessors-api#Examples |
Thank you @jennifer-shehane, Using preprocessor API worked and allowed me to use again the // plugins/index.js
const webpackPreprocessor = require("@cypress/webpack-preprocessor");
const defaults = webpackPreprocessor.defaultOptions;
module.exports = (on) => {
delete defaults.webpackOptions.module.rules[0].use[0].options.presets;
on("file:preprocessor", webpackPreprocessor(defaults));
}; |
This is amazing. Thank you for sharing, @javierbrea! |
Current behavior
babel.config.js
file seems to be ignored in Cypress v8. I was using it in previous Cypress versions to configure babel aliases to be used in Cypressintegration
andsupport
files usingbabel-plugin-module-resolver
.Now, with a
babel.config.js
file like this:I receive this error:
Desired behavior
It is desirable that Cypress continues supporting custom babel configuration files when processing
integration
,support
orplugins
files, or at least any valid alternative for customizing babel config.Test code to reproduce
You can reproduce the error in the cypress-localstorage-commands repository, branch
chore-330-cypress-v8
.Running
npm run test:e2e
produces the described error, while running it in themaster
branch (which is using Cypress v7 in E2E tests) works properly.Cypress Version
8.0.0
Other
No response
The text was updated successfully, but these errors were encountered: