Skip to content

fix(title): render app title at request time so APP_TITLE applies#41

Merged
spinsirr merged 1 commit into
mainfrom
fix/calibration-title-dynamic
Jun 27, 2026
Merged

fix(title): render app title at request time so APP_TITLE applies#41
spinsirr merged 1 commit into
mainfrom
fix/calibration-title-dynamic

Conversation

@spinsirr

Copy link
Copy Markdown
Collaborator

Bug: the app title reverted to gbrain on every refresh despite APP_TITLE=CoreSpeed Library being set on Railway.

Root cause (not client-side, not gbrain): appTitle is read server-side via loadConfig() from process.env.APP_TITLE. But the pages were statically prerendered at build time (SSG), and the Docker build stage has no Railway service vars → the gbrain default got baked into the HTML. The runtime APP_TITLE was 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 runtime APP_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.

…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>
@spinsirr spinsirr merged commit 8b7c2d0 into main Jun 27, 2026
1 check 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