mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
This ensures we don't fail to return the full body when storing to fetch-cache in edge-runtime. Also ensures the fetch cache tests are running for Node.js v16 correctly. Fetch handling was also failing on Node.js v16 due to react's use of `res.clone()` being broken with undici which is fixed in the latest version of edge-runtime so this bumps that. x-ref: [slack thread](https://vercel.slack.com/archives/C03S8ED1DKM/p1681310566927429)
23 lines
496 B
JavaScript
23 lines
496 B
JavaScript
export const runtime = 'experimental-edge'
|
|
|
|
export default async function Page() {
|
|
const data = await fetch(
|
|
'https://next-data-api-endpoint.vercel.app/api/echo-body',
|
|
{
|
|
next: {
|
|
revalidate: 3,
|
|
},
|
|
method: 'POST',
|
|
duplex: 'half',
|
|
body: JSON.stringify({ hello: 'world' }),
|
|
}
|
|
).then((res) => res.json())
|
|
|
|
return (
|
|
<>
|
|
<p id="page">/variable-revalidate-edge/encoding</p>
|
|
<p id="page-data">{JSON.stringify(data)}</p>
|
|
</>
|
|
)
|
|
}
|