Skip to content

Commit

Permalink
docs: removing next.js global style workaround in ct troubleshooting …
Browse files Browse the repository at this point in the history
…guide (#4771)

Issue was fix in cypress-io/cypress#22769
  • Loading branch information
elylucas authored Oct 6, 2022
1 parent 230eda1 commit 548c26d
Showing 1 changed file with 0 additions and 18 deletions.
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>

1 comment on commit 548c26d

@vercel
Copy link

@vercel vercel bot commented on 548c26d Oct 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.