Skip to content

docs: removing next.js global style workaround in ct troubleshooting … #4771

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

Merged
merged 1 commit into from
Oct 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions content/guides/component-testing/component-test-troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,3 @@ files inside that folder should use.
Don't forget to update your
[`specPattern`](https://docs.cypress.io/guides/references/configuration#component)
to include the new file location.

### Next.js Global Style Error

If you import the Next `styles/globals.css` in `cypress/support/component.js` to
style your components, you'll get an error from Next about not allowing
importing global css from files other than your main app file.

To solve this, install the
[`next-global-css`](https://www.npmjs.com/package/next-global-css) package and
update the Next Webpack configuration.

<Alert type="info">

See our <Icon name="github"></Icon>
[example Next.js application](https://github.com/cypress-io/cypress-component-testing-apps/blob/v10-complete/react-next12-ts/next.config.js)
for a demonstration of this configuration.

</Alert>