-
-
Couldn't load subscription status.
- Fork 1.3k
Description
Describe the bug
I'm currently developing a Next.js v14 project that utilizes the App router to statically generate a significant number of pages, including blog articles, at build time.
I'm trying to integrate Wagmi along with Web3Modal into my app. However, following the guidelines provided in the Wagmi documentation, I encountered an issue. Specifically, when I enable the ssr property within the Wagmi Config, proceed to establish cookie storage, and then hydrate the cookies as instructed, I've observed that all my Next.js application's routes inadvertently switch to being server-side rendered (SSR) pages.
Has anyone found a workaround?
Link to Minimal Reproducible Example
No response
Steps To Reproduce
- Set up a nextjs project with at least one static page (prerendered as static content)
- Set up wagmi and follow the steps here to set up wagmi properly with SRR.
- The page that was static is now dynamic (server-rendered on demand using Node.js) because of initialState being passed to the component
export default function Layout({ children }: { children: ReactNode }) { const initialState = cookieToInitialState( config, headers().get('cookie') ) return ( <html lang="en"> <body> <Providers initialState={initialState}> {children} </Providers> </body> </html> ) }
Wagmi Version
Latest
Viem Version
Latest
TypeScript Version
5.1.3
Check existing issues
- I checked there isn't already an issue for the bug I encountered.
Anything else?
No response