Skip to content

fix(roadmap): render the feature graph per request, not at build time - #351

Merged
QSchlegel merged 1 commit into
preprodfrom
claude/fix-graph-prerender
Jul 27, 2026
Merged

fix(roadmap): render the feature graph per request, not at build time#351
QSchlegel merged 1 commit into
preprodfrom
claude/fix-graph-prerender

Conversation

@QSchlegel

Copy link
Copy Markdown
Collaborator

The preprod deploy of a336539 failed and preprod has been serving a stale build since. The site is up — / and /features return 200 — but it is the pre-merge build, so /roadmap and /roadmap/graph 404.

Cause

Error: NextRouter was not mounted.
Error occurred prerendering page "/roadmap/graph"
Export encountered an error on /roadmap/graph, exiting the build.

/roadmap/graph used getStaticProps, which makes Next prerender the page at build time. This app is a client-only SPA whose shell calls useRouter outside a mounted router, so the export step dies.

Every other page in the app uses a no-op getServerSideProps — precisely because the shell isn't prerender-safe. This page was the one deviation, and the deviation is what broke. I flagged it as a deliberate deviation in the original commit message; that call was wrong.

Worth noting it survived a local build: npm run build is next build --webpack, the same command Railway runs, and it prerendered /roadmap/graph fine locally — including on a clean build with .next removed. Rather than chase a builder-environment difference, the page now follows the app's convention.

Changes

  • getStaticPropsgetServerSideProps on /roadmap/graph.
  • loadVaultGraph is memoised — once per process in production, uncached in development so editing a note and refreshing still works. Per-request parsing of ~66 files would otherwise be waste.
  • vault/ re-included in .dockerignore. Build-time parsing tolerated the blanket *.md filter; runtime parsing does not, and a missing vault would render an empty graph rather than fail loudly.

Verification

On a clean build (rm -rf .next && npm run build):

  • /roadmap/graph is now ƒ (server-rendered on demand) instead of (prerendered), so the export step that crashed no longer runs
  • serves 200, with all 52 feature nodes in the payload
  • 514 unit tests pass, no typecheck errors in the changed files

Once this merges, the preprod deploy should go green and both pages come up.

The preprod deploy of a336539 failed and the environment has been serving
a stale build since:

  Error: NextRouter was not mounted.
  Error occurred prerendering page "/roadmap/graph"
  Export encountered an error on /roadmap/graph, exiting the build.

/roadmap/graph used getStaticProps, which makes Next prerender the page at
build time. This app is a client-only SPA whose shell calls useRouter
outside a mounted router, so the export step dies. Every other page here
uses a no-op getServerSideProps for exactly that reason — this page was
the one deviation, and the deviation is what broke.

It survived a local `next build --webpack` (the same command Railway runs,
verified) and failed on the Railway builder, including on a clean build
with no .next cache. Rather than chase an environment difference, the page
now follows the app's convention.

Reading per request means parsing ~66 files per visitor, so loadVaultGraph
is memoised: once per process in production, uncached in development so
editing a note and refreshing still works.

Also re-includes vault/ in .dockerignore. Build-time parsing tolerated the
blanket `*.md` filter; runtime parsing does not, and an empty vault would
render an empty graph rather than fail loudly.

Verified on a clean build: /roadmap/graph is now ƒ rather than ●, serves
200, and the payload carries all 52 feature nodes. 514 tests pass.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
multisig Building Building Preview, Comment Jul 27, 2026 10:52am

Request Review

@QSchlegel
QSchlegel merged commit 629a652 into preprod Jul 27, 2026
5 of 6 checks 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