Closed andrewliden closed 1 hour ago
Reproduction repository is not correct?
Reproduction repository is not correct?
Are you referring to the fact that the template was created with npx create-next-app -e reproduction-template instead of npx create-next-app -e reproduction-template-app-dir?
If so, I'm sorry, I just didn't notice that the app directory template was separate when I started making the bug reproduction repository. The repository does use the app directory, though. I could update the repository if needed, just let me know.
Reproduction repository is not correct?
I went ahead and created a new branch that's using the app directory template. I edited the issue to link to that branch, as well. Hopefully that helps.
Does node-fetch support response cloning? In Node 16 there's no fetch
on the Node runtime, so IIRC, Next.js polyfills it with node-fetch.
Does node-fetch support response cloning? In Node 16 there's no
fetch
on the Node runtime, so IIRC, Next.js polyfills it with node-fetch.
It seems so. https://github.com/node-fetch/node-fetch/blob/main/src/response.js#L89
It might be worth noting that I first ran into this problem because a project I was working on was crashing unexpectedly due to responses attempting to call .clone()
. None of the code in that project actually called .clone()
, so it would seem it might be used under the hood somewhere. I had some trouble reproducing that behavior, though, so I just reproduced the exception with .clone()
since that seems to be what was causing my problems anyways.
My solution to this was keep your dev server running while deploying it on vercel or ceating a local build... 💀
My solution to this was keep your dev server running while deploying it on vercel or ceating a local build... 💀
For me it was resolved when I updated to Node v18, so I just updated the container to use that. The documentation claimed that Node v16.8 and later is supposed to be supported though.
The current minimal Node.js support version is v18.17 → https://nextjs.org/docs/app/building-your-application/upgrading/app-router-migration#nodejs-version.
Since v16 is no longer supported, I will be closing this issue!
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue
https://github.com/andrewliden/nextjs-appdir-node16-bug-reproduction/tree/appdir-template
To Reproduce
Make sure your Node version is 16.20. Start the reproduction template with
next dev
. Open the homepage in your browser. The homepage will perform a request withfetch
and attempt to clone the response. You will get a "Found invalid object in transferList" error.Describe the Bug
Cloning a response in node 16.20 throws an exception. This can cause a wide range of issues, and is generally unexpected. The documentation currently states that the minimum supported version of node is 16.8.
Expected Behavior
Cloning a response should not throw an exception in Node 16, unless Node 16 is no longer intended to be supported.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response