fix(roadmap): render the feature graph per request, not at build time - #351
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The preprod deploy of
a336539failed and preprod has been serving a stale build since. The site is up —/and/featuresreturn 200 — but it is the pre-merge build, so/roadmapand/roadmap/graph404.Cause
/roadmap/graphusedgetStaticProps, which makes Next prerender the page at build time. This app is a client-only SPA whose shell callsuseRouteroutside 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 buildisnext build --webpack, the same command Railway runs, and it prerendered/roadmap/graphfine locally — including on a clean build with.nextremoved. Rather than chase a builder-environment difference, the page now follows the app's convention.Changes
getStaticProps→getServerSidePropson/roadmap/graph.loadVaultGraphis 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*.mdfilter; 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/graphis nowƒ(server-rendered on demand) instead of●(prerendered), so the export step that crashed no longer runsOnce this merges, the preprod deploy should go green and both pages come up.