Next.js CT apps have "Component Testing Mismatched Dependencies" warning for deps it doesn't need.
See original GitHub issueCurrent behavior
When booting up a Next.js app for CT testing, a warning for Component Testing Mismatched Dependencies
is displayed on the “Open Browser” page. This warning says that the application is missing “webpack”, but Next.js applications don’t require webpack since Next bundles it internally.
Desired behavior
The warning should not show when launching Next.js Component Testing
Test code to reproduce
npx create-next-app my-next-app && cd my-next-app
npm i -D cypress
npx cypress open
- Walk through CT setup, “Choose a browser” page will show misleading warning.
Cypress Version
10.4.0
Other
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
How to fix missing dependency warning when using useEffect ...
I have this current setup, React hook useEffect runs continuously forever/infinite loop and the only comment is about useCallback() which I'm not familiar...
Read more >RFC: Global CSS Imports #27953 - vercel/next.js - GitHub
I have two nextjs app that have a bunch of common components. To avoid repeating/copy pasting I create a small component library to...
Read more >react-version | Next.js
Component stack trace in development: see the component tree that lead up to an error; Hydration mismatch warnings: trace down discrepancies in your...
Read more >Component Testing Config - Cypress Documentation
When you launch Cypress for the first time in a project, the app will automatically guide you through setup and configuration. You don't...
Read more >How to Create and Publish a React Component Library
All code from this tutorial as a complete package is available in this repository. If you are... Tagged with webdev, react, javascript, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@JasonFairchild I think you are right in suggesting the mismatched bug was introduced in https://github.com/cypress-io/cypress/issues/23216#issuecomment-1213493767 - that’s where we added the dependencies check feature, but missed the edge case of Next.js and the inline webpack they ship.
Also the stacking errors looks bad, that’s definitely a separate bug we should address.
Released in
10.8.0
.This comment thread has been locked. If you are still experiencing this issue after upgrading to Cypress v10.8.0, please open a new issue.