[Fix] Don't SSR the /free/[slug] chat shell - #1696
Conversation
|
@CREDO23 is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
/free/[slug]chat chrome client-only so SSG no longer touchesdocumentTest plan
0.0.37+SURFSENSE_BACKEND_INTERNAL_URL=https://api.surfsense.com pnpm run builddies on/free/gpt-5.4-mini-no-login(document is not defined)/free/gpt-5.4-mini-no-loginand/free/gpt-o4-mini-no-loginHigh-level PR Summary
This PR fixes a Static Site Generation (SSG) build error caused by the chat shell trying to access
documentduring server-side rendering. The solution disables SSR for the/free/[slug]chat interface by using Next.js dynamic imports withssr: false, while preserving the prerendering of SEO-critical content like JSON-LD and FAQ sections. The chat providers (AnonymousModeProvider,LoginGateProvider,FreeLayoutDataProvider) are now wrapped in a client-only component, eliminating the layout.tsx file entirely.⏱️ Estimated Review Time: 15-30 minutes
💡 Review Order Suggestion
surfsense_web/components/free-chat/free-chat-client.test.mjssurfsense_web/components/free-chat/free-chat-client.tsxsurfsense_web/components/free-chat/free-chat-app.tsxsurfsense_web/app/(home)/free/[model_slug]/page.tsxsurfsense_web/app/(home)/free/[model_slug]/layout.tsx