Skip to content

A local build needs SESSION_SECRET, and the failure lies about why - #146

Merged
github-actions[bot] merged 1 commit into
masterfrom
docs/local-build-env
Sep 1, 2026
Merged

A local build needs SESSION_SECRET, and the failure lies about why#146
github-actions[bot] merged 1 commit into
masterfrom
docs/local-build-env

Conversation

@catomean

@catomean catomean commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

CLAUDE.md tells you to run next build before declaring UI work done, and never said how to run it here.

A bare npm run build on this laptop dies with:

Failed to collect configuration for /api/auth/demo

That route queries prisma.user, so the obvious reading is "this machine has no aoz_wohnen database — builds are impossible here."

That reading is wrong. The real cause is further down the same log:

[cause]: Error: SESSION_SECRET environment variable must be set in production
SESSION_SECRET=local-build-only npm run build   # exit 0, 56 static pages

It was believed twice on 2026-09-01 — once confidently enough that I reported it to George as an environment limitation. The cost of the wrong belief is skipping the one gate npm run verify explicitly does not cover: a 'use client' below an import passes lint, typecheck and Jest, and fails only at build.

Two traps stacked underneath it

  • Never pipe the build. npm run build | tail -25 exits with tail's status, so a failed build reports success. This bit twice in one session.
  • An error naming a database-touching route is not evidence about the database. The first line says where it broke, not why. Read to [cause].

Docs only — no code change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Cd183M6472xBgTKWA2is6h

CLAUDE.md told you to run `next build` before declaring UI work done and never
said how. A bare `npm run build` on this laptop dies with

  Failed to collect configuration for /api/auth/demo

and that route queries `prisma.user`, so the obvious reading is "no
`aoz_wohnen` database here, builds are impossible on this machine". Wrong —
and believed twice on 2026-09-01, once confidently enough to be reported to
George as an environment limitation. The real `[cause]`, further down the same
log, is a missing SESSION_SECRET. With it set the build is exit 0, 56 static
pages.

Records the working command and the two traps stacked underneath it: piping
the build hands you tail's exit status so a failure reports success, and an
error naming a database-touching route is not evidence about the database.

The cost of the wrong belief was skipping the one gate `npm run verify`
explicitly does not cover.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Cd183M6472xBgTKWA2is6h
@github-actions
github-actions Bot merged commit 8ede4a5 into master Sep 1, 2026
4 checks passed
@github-actions
github-actions Bot deleted the docs/local-build-env branch September 1, 2026 00:05
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