Skip to content

[Fix] Don't SSR the /free/[slug] chat shell - #1696

Merged
CREDO23 merged 1 commit into
MODSetter:devfrom
CREDO23:fix/free-ssr-document
Aug 19, 2026
Merged

[Fix] Don't SSR the /free/[slug] chat shell#1696
CREDO23 merged 1 commit into
MODSetter:devfrom
CREDO23:fix/free-ssr-document

Conversation

@CREDO23

@CREDO23 CREDO23 commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Load /free/[slug] chat chrome client-only so SSG no longer touches document
  • JSON-LD / FAQ still prerender

Test plan

  • Unfixed 0.0.37 + SURFSENSE_BACKEND_INTERNAL_URL=https://api.surfsense.com pnpm run build dies on /free/gpt-5.4-mini-no-login (document is not defined)
  • Same command with this change prerenders /free/gpt-5.4-mini-no-login and /free/gpt-o4-mini-no-login

High-level PR Summary

This PR fixes a Static Site Generation (SSG) build error caused by the chat shell trying to access document during server-side rendering. The solution disables SSR for the /free/[slug] chat interface by using Next.js dynamic imports with ssr: 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
Order File Path
1 surfsense_web/components/free-chat/free-chat-client.test.mjs
2 surfsense_web/components/free-chat/free-chat-client.tsx
3 surfsense_web/components/free-chat/free-chat-app.tsx
4 surfsense_web/app/(home)/free/[model_slug]/page.tsx
5 surfsense_web/app/(home)/free/[model_slug]/layout.tsx

Need help? Join our Discord

@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

@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.

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 630d92e8-7259-46dd-9398-4d53dcdd49ba

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@CREDO23
CREDO23 merged commit b8089c7 into MODSetter:dev Aug 19, 2026
4 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant