reactjsnext.jsreact-server-components

React precomputed chunk bug


I am using react 18.2.0, next.js 14.1 and express 20.11.1 and keep often but not always getting a warning on my server component like in here https://github.com/vercel/next.js/issues/50602

Warning: A large precomputed chunk was passed to writeChunk without being copied. Large chunks get enqueued directly and are not copied. This is incompatible with precomputed chunks because you cannot enqueue the same precomputed chunk twice. Use "cloneChunk" to make a copy of this large precomputed chunk before writing it. This is a bug in React.

The problem is that I don't have unnecessary async functions that I could remove. I believe the warning is thrown when I pass a lot of data which I fetch in the Server component into my Client component but I also don't see a way of avoiding that.

Anyone has come across this issue?


Solution

  • I was facing similar issue and all I had to do was npm install next@latest. The team might have fixed the issue in the latest version. Tried refreshing multiple times just to re-confirm. But, to my surprise, the warning was gone.