Skip to content

fix: include pageUrlOverrides in getStaticPaths for production builds#10

Open
wustep wants to merge 1 commit intomainfrom
fix/static-paths-url-overrides
Open

fix: include pageUrlOverrides in getStaticPaths for production builds#10
wustep wants to merge 1 commit intomainfrom
fix/static-paths-url-overrides

Conversation

@wustep
Copy link
Owner

@wustep wustep commented Jan 8, 2026

Problem

URL override paths (e.g., /articles, /notes) were returning 404 in production but working on localhost.

Cause

In production, getStaticPaths only generates paths from pages reachable within maxDepth = 1 from the root Notion page. If these pages aren't directly linked from root (e.g., in a toggle or synced block), they won't be pre-rendered at build time.

Solution

Explicitly include all pageUrlOverrides paths in getStaticPaths, ensuring they're pre-rendered at build time regardless of their position in the Notion page hierarchy.

Changes

  • Import pageUrlOverrides from config
  • Combine sitemap paths with URL override paths using a Set for deduplication

URL override paths (e.g., /articles, /notes) may not be in the sitemap
if they're not directly linked from the root Notion page. This ensures
they are pre-rendered at build time, fixing 404s in production.
@vercel
Copy link

vercel bot commented Jan 8, 2026

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

Project Deployment Review Updated (UTC)
me Error Error Jan 8, 2026 6:05am

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