-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat (WIP): support Next.js 16 within component testing #32955
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
base: develop
Are you sure you want to change the base?
Conversation
b498f26 to
8ce0a5d
Compare
8ce0a5d to
cb3758a
Compare
| compilerType: 'client', | ||
| // Required for Next.js > 13 | ||
| hasReactRoot: reactVersion === 18, | ||
| hasReactRoot: reactVersion && reactVersion >= 18, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Boolean Logic Fails with Undefined React Version
The hasReactRoot property is set to undefined when getReactVersion fails to find React, rather than false. The expression reactVersion && reactVersion >= 18 evaluates to undefined when reactVersion is undefined, which may cause unexpected behavior in Next.js webpack configuration that expects a boolean value. This should explicitly coerce to boolean using Boolean(reactVersion && reactVersion >= 18) or reactVersion ? reactVersion >= 18 : false.
cypress
|
|||||||||||||||||||||||||||||||||||||||||||||||||
| Project |
cypress
|
| Branch Review |
feat/support_next_16
|
| Run status |
|
| Run duration | 21m 32s |
| Commit |
|
| Committer | Bill Glesias |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
2
|
|
|
0
|
|
|
28
|
|
|
0
|
|
|
793
|
| View all changes introduced in this branch ↗︎ | |
UI Coverage
61.84%
|
|
|---|---|
|
|
27
|
|
|
47
|
Accessibility
99%
|
|
|---|---|
|
|
0 critical
3 serious
1 moderate
0 minor
|
|
|
19
|
Tests for review
cypress\e2e\runner\ct-framework-errors.cy.ts • 2 failed tests • app-e2e
| Test | Artifacts | |
|---|---|---|
| Angular 18 > error conditions |
Test Replay
Screenshots
|
|
| Angular 19 > error conditions |
Test Replay
Screenshots
|
|
Additional details
Adds component testing support for Next.js 16 (still needs tests). Based on the feedback in #32857, the underlying webpack implementation has changed slightly, where as an
init()function no longer exists but invokes what we need onrequire().Steps to test
How has the user experience changed?
PR Tasks
cypress-documentation?type definitions?Note
Adds Next.js 16 component testing support, updates scaffolding/docs, and adjusts CI filters.
npm/webpack-dev-server/src/helpers/nextHandler.ts.webpackModule.init()(init now runs on require) viasemvercheck.hasReactRootcheck.16in supported versions inpackages/scaffold-config/README.md.WIZARD_DEPENDENCY_NEXT.minVersionto include^16.0.0inpackages/scaffold-config/src/dependencies.ts.15.7.0and note Next.js 16 component testing support incli/CHANGELOG.md.feat/support_next_16and artifact persistence handling in.circleci/src/pipeline/@pipeline.ymlandworkflows/@main.yml.Written by Cursor Bugbot for commit cb3758a. This will update automatically on new commits. Configure here.