TypeError: Cannot assign to read only property 'push' of object '[object Array]' in Next.js 15.3.1 App Router #78823
Labels
invalid link
The issue was auto-closed due to a missing/invalid reproduction link. A new issue should be opened.
I am encountering an issue when using Next.js 15.3.1 with the App Router. The error is:
This error seems to be caused by this code in the Next.js internals:
This is attempting to overwrite the
.push()
method on the arrayself.__next_f
, which is causing aTypeError
. It happens because the.push()
method is being set tonextServerDataCallback
, but the__next_f
array appears to be frozen or immutable in some environments (like when certain browser extensions or security measures are in place).Steps to Reproduce
Actual Behavior
The
.push()
method is being overwritten, which causes a `TypeError in environments where the array is frozen or protected. This results in a failed hydration process, as the client-side JavaScript cannot properly register the server-side data chunks.Expected Behavior
Next.js should handle the
__next_f
array correctly without attempting to overwrite its.push()
method or modify it in a way that triggers aTypeError
. The.push()
method should be left intact, and if modification is needed, an alternative approach should be used.Provide environment
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 24.4.0: Fri Apr 11 18:33:46 PDT 2025; root:xnu-11417.101.15~117/RELEASE_ARM64_T8112
Available memory (MB): 24576
Available CPU cores: 8
Binaries:
Node: 22.15.0
npm: 10.9.2
Yarn: 1.22.19
pnpm: N/A
Relevant Packages:
next: 15.3.1 // Latest available version is detected (15.3.1).
eslint-config-next: 15.3.1
react: 19.1.0
react-dom: 19.1.0
typescript: 5.8.3
Next.js Config:
output: N/A
Additional context
The text was updated successfully, but these errors were encountered: