cloudflare / cloudflare/vinext

App Router ignores `reactStrictMode` in `next.config` (Pages Router only today)

Open
#2,676 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
8.8k
Forks
406
Avg merge
2d 6h
Merged PRs (30d)
120

Description

## Summary

`reactStrictMode` appears to be applied only for the Pages Router in vinext, but not for the App Router.

Based on current code/comments, this seems known internally (`reactStrictMode` is marked as partial), but I couldn't find a dedicated issue tracking App Router parity.

## Current behavior

- `reactStrictMode: true` enables StrictMode behavior for Pages Router client rendering.
- App Router is not wrapped/enforced the same way, so StrictMode checks are not activated there.

## Expected behavior

For Next.js parity, App Router should respect strict mode behavior as well (or document a clear intentional divergence).

## Evidence

In `packages/vinext/src/check.ts`, `reactStrictMode` is explicitly marked as partial with detail similar to:

> enforced for the Pages Router ... App Router is not yet wrapped (Next.js defaults App Router strict mode on)

## Reproduction (high level)

1. Create/use an App Router app on vinext.
2. Set `reactStrictMode: true` in `next.config`.
3. Add a small component that makes StrictMode dev behavior obvious (e.g. effect/log patterns).
4. Compare with equivalent Pages Router setup and/or upstream Next.js behavior.

## Questions

1. Is this a known parity gap to be fixed?
2. Should we track this as a dedicated compatibility issue?
3. If intentional for now, can we document it more prominently in compatibility docs/check output?

Contributor guide

Open the contributing guide

Research direction

Start with the partial `reactStrictMode` entry in `packages/vinext/src/check.ts`, then reproduce the App Router behavior described in the issue and compare it with the Pages Router setup. Done means App Router strict-mode behavior matches the expected Next.js behavior, or the intentional divergence is clearly documented in the compatibility output or documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js, react, typescript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.