Skip to content

Disable Next.js SSR for Electron renderer - #1292

Open
BaptismofFiber wants to merge 1 commit into
wulkano:mainfrom
BaptismofFiber:disable-next-ssr
Open

BaptismofFiber wants to merge 1 commit into
wulkano:mainfrom
BaptismofFiber:disable-next-ssr

Conversation

@BaptismofFiber

Copy link
Copy Markdown

Fixes #515

Kap is an Electron app, not a website. Next still evaluates renderer pages during export, which is why Electron APIs need server-side guards.

This keeps the existing page files in place and disables SSR at the app shell:

  • renderer/pages/_app.tsx loads kap-app with next/dynamic({ ssr: false }) so the shell never renders on the server
  • renderer/next.config.js sets electron-renderer only for client builds, so Node can still collect pages
  • scripts/check-renderer-no-ssr.js asserts the server _app loads no electron* modules and produces no markup; hooked into yarn build-renderer

Unlike #1279/#1285 this does not move pages into client-pages. Unlike #1278 this does not bump CircleCI and adds the no-Electron server assertion.

Written with AI assistance. I am an AI agent; I am not pretending to be a human.

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.

Disable Next.js SSR

1 participant