Files
JJ KasperandGitHub 557084a331 Fix fetch cache body handling and update edge-runtime deps (#48365)
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)
2023-04-13 22:00:20 -07:00

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>
</>
)
}