Skip to content
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

fix: initialise nextjs webpack before importing devserver #15881

Closed
wants to merge 1 commit into from
Closed

fix: initialise nextjs webpack before importing devserver #15881

wants to merge 1 commit into from

Conversation

djsilcock
Copy link
Contributor

@djsilcock djsilcock commented Apr 8, 2021

User facing changelog

Fixed integration with nextjs for component test runner

Additional details

NextJs provides its own webpack bundle, rather than listing it as a [peer] dependency. This leads to two separate instances, and potentially two separate versions, of webpack being in use simultaneously.
The NextJs config adds a require hook such that require('webpack') returns the bundled NextJs version appropriate to the {future:webpack5} setting in config.next.js - but as the @cypress/webpack-devserver package requires webpack, this only works if that package is required after the next config file has run

How has the user experience changed?

cypress open-ct now progresses to show test runner when next config is used as per the example in the repository

PR Tasks

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Apr 8, 2021

Thanks for taking the time to open a PR!

@CLAassistant
Copy link

CLAassistant commented Apr 8, 2021

CLA assistant check
All committers have signed the CLA.

@djsilcock djsilcock changed the title initialise nextjs webpack before importing devserver fix: initialise nextjs webpack before importing devserver Apr 8, 2021
@djsilcock djsilcock changed the base branch from develop to master April 8, 2021 18:30
@djsilcock djsilcock changed the base branch from master to develop April 8, 2021 18:41
@djsilcock djsilcock closed this Apr 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[7.0.1] Component testing not working with Next.js and future.webpack5 configuration
2 participants