-
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
@cypress/react/plugins/babel doesn't work in a monorepo #16596
Labels
npm: @cypress/react
@cypress/react package issues
Comments
penx
added a commit
to penx/cypress
that referenced
this issue
May 19, 2021
Allow babel loader options to be configurable to support running within a monorepo. Fixes cypress-io#16596
4 tasks
cypress-bot
bot
added
the
stage: needs review
The PR code is done & tested, needs review
label
May 19, 2021
cypress-bot
bot
added
stage: work in progress
stage: needs review
The PR code is done & tested, needs review
and removed
stage: needs review
The PR code is done & tested, needs review
stage: work in progress
labels
May 20, 2021
lmiller1990
added a commit
that referenced
this issue
May 21, 2021
* Allow babel loader options to be configurable Allow babel loader options to be configurable to support running within a monorepo. Fixes #16596 * new configuration option in cypress.schema.json * Revert "new configuration option in cypress.schema.json" This reverts commit 0a39322. * support custom webpack configuration via config function * fix linting issue * Update getBabelWebpackConfig.js * linting Co-authored-by: Lachlan Miller <[email protected]>
The code for this is done in cypress-io/cypress#16597, but has yet to be released. |
cypress-bot
bot
removed
the
stage: needs review
The PR code is done & tested, needs review
label
May 21, 2021
It's out in cypress/react 5.8.0. |
Brookke
pushed a commit
to Brookke/cypress
that referenced
this issue
May 22, 2021
* Allow babel loader options to be configurable Allow babel loader options to be configurable to support running within a monorepo. Fixes cypress-io#16596 * new configuration option in cypress.schema.json * Revert "new configuration option in cypress.schema.json" This reverts commit 0a39322. * support custom webpack configuration via config function * fix linting issue * Update getBabelWebpackConfig.js * linting Co-authored-by: Lachlan Miller <[email protected]>
pashidlos
pushed a commit
to pashidlos/cypress
that referenced
this issue
May 24, 2021
* Allow babel loader options to be configurable Allow babel loader options to be configurable to support running within a monorepo. Fixes cypress-io#16596 * new configuration option in cypress.schema.json * Revert "new configuration option in cypress.schema.json" This reverts commit 0a39322. * support custom webpack configuration via config function * fix linting issue * Update getBabelWebpackConfig.js * linting Co-authored-by: Lachlan Miller <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current behavior
If you import @cypress/react/plugins/babel in your cypress code in a package in a monorepo, and run
yarn cypress open-ct
, it doesn't resolve the babel config from the monorepo route and throws an error:This is due to babel not searching upwards for the babel config by default.
Desired behavior
Babel should be configurable to search upwards in a monorepo to find the babel config.
As explained here:
https://babeljs.io/docs/en/config-files#monorepos
rootMode: "upward"
needs to be optionally specified in getBabelWebpackConfig.I will open a PR to allow this to be sent via a config option.
Test code to reproduce
https://github.com/govuk-react/govuk-react/tree/c7aea92bec8d5d6b0c65a6cb821ddf60cfb11233
Versions
The text was updated successfully, but these errors were encountered: