You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clone https://github.com/arcanis/next-bug-context-ssr, run yarn && yarn next dev, and open localhost. It will crash. If you run yarn add next@12.1.5-canary.1 before restarting the server, it'll work.
I'm not sure if the actual problem comes from Next having a regression, or next-urql doing something bad, so I figured I should open an issue on both trackers - the Next.js counterpart is vercel/next.js#36198.
Expected behavior
Should work.
Actual behavior
I have some contexts defined inside layout components (using a pattern similar to the one described here), and since this upgrade those contexts are missing in the SSR build, crashing the direct page load (navigating to the page client-side works fine). It's almost as if pages were built without the _app wrapper.
The text was updated successfully, but these errors were encountered:
I ran into the same issue as you and narrowed it down to a change in canary.1 and canary.2 as well. I was able to get it working by disabling Suspense in urql via the options in withUrqlClient. e.g.
{ ssr: true, neverSuspend: true }
I haven't dug into it too much but it seems like something changed in Next that is causing prepass to maybe not be catching errors anymore? LMK if neverSuspend fixes your issue; it seems to have resolved my inability to access context when doing SSR
The problem seems to have been a regression now fixed in Next; it's not released yet, but I had success building a fresh next package off their main branch and referencing it via a file: dependency.
Steps to reproduce
Clone https://github.com/arcanis/next-bug-context-ssr, run
yarn && yarn next dev
, and open localhost. It will crash. If you runyarn add next@12.1.5-canary.1
before restarting the server, it'll work.I'm not sure if the actual problem comes from Next having a regression, or next-urql doing something bad, so I figured I should open an issue on both trackers - the Next.js counterpart is vercel/next.js#36198.
Expected behavior
Should work.
Actual behavior
I have some contexts defined inside layout components (using a pattern similar to the one described here), and since this upgrade those contexts are missing in the SSR build, crashing the direct page load (navigating to the page client-side works fine). It's almost as if pages were built without the _app wrapper.
The text was updated successfully, but these errors were encountered: