Fix store static export build for dynamic product routes #13

Closed
opened 2026-07-17 20:52:59 +00:00 by yuris · 1 comment
Owner

Context

Issue #9 cutover verification is blocked: pnpm --filter garage-store build fails with Next.js 16.2.10 even though apps/store/app/products/[slug]/page.tsx exports generateStaticParams().

Observed error:

Page "/products/[slug]" is missing "generateStaticParams()" so it cannot be used with "output: export" config.

Goal

Make the store production build generate apps/store/out/ successfully from the monorepo.

Acceptance criteria

  • pnpm --filter garage-store build succeeds.
  • apps/store/out/index.html and product static routes are generated.
  • Existing catalog fetching and strict parsing behavior remain intact.
  • The fix uses the smallest compatible Next.js/API change; upgrade Next only if research shows it is the cause.
  • Add or update a regression check where practical.

Relationship

Blocks cutover issue #9. Close this issue when the static build is verified from merged main.

Non-goals

  • Changing the store from static hosting to server hosting.
  • Changing the catalog contract.
## Context Issue #9 cutover verification is blocked: `pnpm --filter garage-store build` fails with Next.js 16.2.10 even though `apps/store/app/products/[slug]/page.tsx` exports `generateStaticParams()`. Observed error: ``` Page "/products/[slug]" is missing "generateStaticParams()" so it cannot be used with "output: export" config. ``` ## Goal Make the store production build generate `apps/store/out/` successfully from the monorepo. ## Acceptance criteria - `pnpm --filter garage-store build` succeeds. - `apps/store/out/index.html` and product static routes are generated. - Existing catalog fetching and strict parsing behavior remain intact. - The fix uses the smallest compatible Next.js/API change; upgrade Next only if research shows it is the cause. - Add or update a regression check where practical. ## Relationship Blocks cutover issue #9. Close this issue when the static build is verified from merged main. ## Non-goals - Changing the store from static hosting to server hosting. - Changing the catalog contract.
Author
Owner

Research result: Next.js 16.2.10 is current (pnpm view next version returns 16.2.10); no upgrade is available or indicated. generateStaticParams() is present and works. The failure occurs only when the local catalog has zero published items: Next's static exporter rejects the dynamic route with the misleading missing-function message. After inserting one temporary published inventory item, pnpm --filter garage-store build succeeded and generated /products/local-test-oil; the temporary row was removed afterward.

Conclusion: no code PR is justified. Production static export requires at least one published catalog item, or the store route architecture must be changed intentionally. This issue should be handled as a cutover/data prerequisite rather than a Next upgrade.

Research result: Next.js 16.2.10 is current (`pnpm view next version` returns 16.2.10); no upgrade is available or indicated. `generateStaticParams()` is present and works. The failure occurs only when the local catalog has zero published items: Next's static exporter rejects the dynamic route with the misleading missing-function message. After inserting one temporary published inventory item, `pnpm --filter garage-store build` succeeded and generated `/products/local-test-oil`; the temporary row was removed afterward. Conclusion: no code PR is justified. Production static export requires at least one published catalog item, or the store route architecture must be changed intentionally. This issue should be handled as a cutover/data prerequisite rather than a Next upgrade.
yuris closed this issue 2026-07-17 21:15:07 +00:00
Sign in to join this conversation.
No labels
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
yuris/garage#13
No description provided.