Docker build fails: category page metadata reads the database while prerendering #134

Closed
opened 2026-11-05 21:45:06 +01:00 by miko · 1 comment
Owner

The Docker build of v1.2.0 fails in npm run build: prerendering /c/[...slug] throws "error parsing connection string", because there is no DATABASE_URL in the build.

generateMetadata in src/app/c/[...slug]/page.tsx (added in #104) starts loadFullCategoryTree() in parallel with await params, so it hits the database before anything makes the route dynamic. A local build doesn't notice, since a database is reachable there.

Fix: await params first, then load the tree, as src/app/[slug]/page.tsx does.

The Docker build of v1.2.0 fails in `npm run build`: prerendering `/c/[...slug]` throws "error parsing connection string", because there is no DATABASE_URL in the build. `generateMetadata` in `src/app/c/[...slug]/page.tsx` (added in #104) starts `loadFullCategoryTree()` in parallel with `await params`, so it hits the database before anything makes the route dynamic. A local build doesn't notice, since a database is reachable there. Fix: await `params` first, then load the tree, as `src/app/[slug]/page.tsx` does.
miko closed this issue 2026-11-05 21:45:36 +01:00
Author
Owner

Fixed in #135 and brought to master with #136; the v1.2.0 tag and release now point to the fixed master (c4328f6), and the Docker image is built from it.

Fixed in #135 and brought to master with #136; the v1.2.0 tag and release now point to the fixed master (c4328f6), and the Docker image is built from it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MassiveDynamic/kataba#134
No description provided.