Open artooras opened 7 months ago
I'm getting the same error, did you manage to find a solution?
Hi! We noticed there hasn’t been activity on this issue in a while. After 30 days, it will close automatically.
If it’s still relevant, or you have updates, comment and let us know. And don’t worry, you can always re-open later if needed.
Summary
Answers in this issue by @ry5n seem to suggest that Polaris should be fully SSR compatible. However, I get an error when I try to do so.
Expected behavior
Polaris to be rendered on the server without errors.
Actual behavior
I'm using Shopify Polaris in a Next.js (v14) app using their App router, allowing for easy switching between SSR and CSR by removing or adding the
'use client'
directive in the file. So, when I render thelayout.tsx
of my app using'use client'
, it works. However, when I remove it thus forcing the route to render on the server, I get the following error (it seems that Polaris uses React Context internally...):The code in my
layout.tsx
is quite simple:Steps to reproduce
Sandbox
Are you using React components?
Yes
Polaris version number
12.21.0
Browser
Firefox 124.0.2
Device
Macbook Air