Skip to content

feat(rendering): force dynamic rendering for all (app) routes#27

Merged
itinsecurity merged 5 commits intomainfrom
004-dynamic-rendering
Mar 19, 2026
Merged

feat(rendering): force dynamic rendering for all (app) routes#27
itinsecurity merged 5 commits intomainfrom
004-dynamic-rendering

Conversation

@itinsecurity
Copy link
Copy Markdown
Owner

Summary

  • Adds export const dynamic = 'force-dynamic' to all four files in the authenticated (app) route group (layout.tsx, holdings/page.tsx, holdings/[id]/page.tsx, portfolio/page.tsx)
  • Fixes build failure when DATABASE_URL is not set at build time — Next.js no longer attempts to statically pre-render pages that call Prisma
  • Adds Playwright E2E test (tests/e2e/dynamic-rendering.spec.ts) verifying the holdings page serves fresh data after an update without a rebuild

Test plan

  • npm run build with DATABASE_URL unset completes with zero errors; (app) routes show ƒ (Dynamic) in build output
  • npx tsc --noEmit — 0 errors
  • npm run test — 101 tests passing
  • E2E: npm run test:e2e — dynamic-rendering spec passes (add holding → update account name → full page nav → fresh data visible)

🤖 Generated with Claude Code

itinsecurity and others added 5 commits March 19, 2026 20:02
Add `export const dynamic = 'force-dynamic'` to all four files in the
authenticated (app) route group so Next.js renders them at request time
instead of statically pre-rendering during `next build`. This allows the
application to build successfully without a database being available.

Also adds a Playwright E2E test that verifies the holdings page serves
fresh data after an update without requiring a rebuild.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Scope row selector to uniqueAccount instead of /DYNTEST/ to avoid
  strict mode violations when prior runs leave DYNTEST rows in the DB
- Wait for the Edit button to reappear after saving (proves the server
  action completed) before navigating to /holdings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Playwright name matching is substring by default; "Open in editor" buttons
injected by the dev toolbar match /edit/i, causing a strict mode violation.
Adding exact: true constrains the locator to the button with accessible
name exactly "Edit".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Next.js 16 forbids non-async-function exports from "use server" files.
EDITABLE_PROFILE_FIELDS is a constant array, not a function, so it
violates this constraint and crashes the holding detail page at runtime.

Move the constant to src/lib/profileFields.ts (a plain module with no
"use server" directive) and import it in profiles.ts and the test file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
getByText(updatedAccount) matches both the account filter <option> and
the table <td>, causing a strict mode violation. getByRole("cell") only
matches table cells, not option elements.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@itinsecurity itinsecurity merged commit 19946d1 into main Mar 19, 2026
9 checks passed
@itinsecurity itinsecurity deleted the 004-dynamic-rendering branch March 19, 2026 19:44
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