Skip to content

Conversation

@AtofStryker
Copy link
Contributor

@AtofStryker AtofStryker commented Nov 14, 2025

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 on require().

Screenshot 2025-11-14 at 3 04 11 PM

Steps to test

How has the user experience changed?

PR Tasks


Note

Adds Next.js 16 component testing support, updates scaffolding/docs, and adjusts CI filters.

  • Component Testing (Webpack Dev Server):
    • Add Next.js 16 support in npm/webpack-dev-server/src/helpers/nextHandler.ts.
    • Handle Next ≥16 by skipping webpackModule.init() (init now runs on require) via semver check.
    • Normalize Webpack detection to v5 and adjust hasReactRoot check.
    • Refresh Next base webpack config option typing/comments for v14–v16.
  • Scaffolding:
    • Include Next.js 16 in supported versions in packages/scaffold-config/README.md.
    • Extend WIZARD_DEPENDENCY_NEXT.minVersion to include ^16.0.0 in packages/scaffold-config/src/dependencies.ts.
  • CLI Changelog:
    • Bump to 15.7.0 and note Next.js 16 component testing support in cli/CHANGELOG.md.
  • CI:
    • Add branch filter feat/support_next_16 and artifact persistence handling in .circleci/src/pipeline/@pipeline.yml and workflows/@main.yml.

Written by Cursor Bugbot for commit cb3758a. This will update automatically on new commits. Configure here.

@AtofStryker AtofStryker self-assigned this Nov 14, 2025
compilerType: 'client',
// Required for Next.js > 13
hasReactRoot: reactVersion === 18,
hasReactRoot: reactVersion && reactVersion >= 18,
Copy link

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.

Fix in Cursor Fix in Web

@cypress
Copy link

cypress bot commented Nov 14, 2025

cypress    Run #67360

Run Properties:  status check failed Failed #67360  •  git commit cb3758a724: feat: support Next.js 16 inside component testing
Project cypress
Branch Review feat/support_next_16
Run status status check failed Failed #67360
Run duration 21m 32s
Commit git commit cb3758a724: feat: support Next.js 16 inside component testing
Committer Bill Glesias
View all properties for this run ↗︎

Test results
Tests that failed  Failures 2
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 28
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 793
View all changes introduced in this branch ↗︎
UI Coverage  61.84%
  Untested elements 27  
  Tested elements 47  
Accessibility  99%
  Failed rules  0 critical   3 serious   1 moderate   0 minor
  Failed elements 19  

Tests for review

Failed  cypress\e2e\runner\ct-framework-errors.cy.ts • 2 failed tests • app-e2e

View Output

Test Artifacts
Angular 18 > error conditions Test Replay Screenshots
Angular 19 > error conditions Test Replay Screenshots

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.

Support Next.js 16 for Component Testing

2 participants