tss-react icon indicating copy to clipboard operation
tss-react copied to clipboard

Next.js with runtime experimental-edge enabled will result in error: [Error: `getInitialProps` in Document component is not supported with the Edge Runtime.]

Open bobsingor opened this issue 2 years ago • 1 comments
trafficstars

I wish to use MUI with TSS-react in Next.js with experimental-edge enabled.

This results in the following error:

[Error: getInitialProps in Document component is not supported with the Edge Runtime.]

Is there a workaround for this?

bobsingor avatar Jan 25 '23 23:01 bobsingor

Hi @bobsingor,

Thats a bummer,
I don't thik there is a workaround no, this is something related to @emotion.
If you look at the recommendend MUI setup for Next.js they also uses Document.getInitialProps: https://github.com/mui/material-ui/blob/a722357b47d5572301334bb716c985e770046ced/examples/nextjs-with-typescript/pages/_document.tsx#L67

Are you using MUI?

I suggest you submit a issue on the https://github.com/emotion-js/emotion repo?

garronej avatar Jan 26 '23 09:01 garronej