You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Run next dev, in which POST requests are not cached by default
Navigating between different pages under /continents shows different sets of countries, logs the continent correctly
Run next build, which causes fetch to cache POST requests
All continent pages use the same data, all log entries report the same continent
(Only the continent page sends GraphQL queries as ArrayBuffers, other pages use graphql-request which is cached correctly.)
Current vs. Expected behavior
SSG forces POST requests to be cached, under a different key for each POST body. However it can only serialize ReadableStream, Blob, FormData/URLSearchParams or string bodies, but not ArrayBuffer:
Link to the code that reproduces this issue
https://github.com/rwalisa/nextjs-arraybuffer-post-bug-demo
To Reproduce
next dev
, in which POST requests are not cached by defaultnext build
, which causes fetch to cache POST requests(Only the continent page sends GraphQL queries as ArrayBuffers, other pages use
graphql-request
which is cached correctly.)Current vs. Expected behavior
SSG forces POST requests to be cached, under a different key for each POST body. However it can only serialize ReadableStream, Blob, FormData/URLSearchParams or string bodies, but not ArrayBuffer:
next.js/packages/next/src/server/lib/incremental-cache/index.ts
Lines 280 to 350 in 5e236c9
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #26~22.04.1-Ubuntu SMP Thu Jul 11 22:33:04 UTC 2024 Available memory (MB): 15982 Available CPU cores: 4 Binaries: Node: 20.2.0 npm: 9.6.6 Yarn: 1.22.22 pnpm: 10.4.1 Relevant Packages: next: 15.2.0-canary.67 // Latest available version is detected (15.2.0-canary.67). eslint-config-next: 15.2.0-canary.67 react: 19.1.0-canary-32b0cad8-20250213 react-dom: 19.1.0-canary-32b0cad8-20250213 typescript: 5.7.2 Next.js Config:
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next build (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: