fix(title): render app title at request time so APP_TITLE applies#41
Merged
Conversation
…lies The app title (APP_TITLE, default "gbrain") reverted to "gbrain" on every refresh even though APP_TITLE was set. Root cause: the title pages are server components read via loadConfig(), but Next statically prerendered them at BUILD time — and the Docker build stage has no Railway service vars, so the "gbrain" default got baked into the HTML; the runtime APP_TITLE was never read. Add `export const dynamic = "force-dynamic"` to the root layout so the routes render per-request (still SSR — dynamic, not static prerender), reading the runtime APP_TITLE. Future title changes need only a restart, no rebuild. Verified: `/` and `/[...path]` now build as ƒ (Dynamic); typecheck + vitest (74) + next build all green. Co-Authored-By: Zypher Agent <zypher@corespeed.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug: the app title reverted to
gbrainon every refresh despiteAPP_TITLE=CoreSpeed Librarybeing set on Railway.Root cause (not client-side, not gbrain):
appTitleis read server-side vialoadConfig()fromprocess.env.APP_TITLE. But the pages were statically prerendered at build time (SSG), and the Docker build stage has no Railway service vars → thegbraindefault got baked into the HTML. The runtimeAPP_TITLEwas never read.Fix:
export const dynamic = "force-dynamic"on the root layout → pages render per-request on the server (still SSR, just dynamic instead of static prerender), reading runtimeAPP_TITLE. Title changes now need only a restart, no rebuild.Verified:
/+/[...path]build as ƒ (Dynamic); typecheck + vitest 74 + next build green. One-line change to layout.tsx.