Non-ASCII page slugs 404 with "Notion page not found" (App Router params not decoded)
Description
On the current App Router setup (app/[pageId]/page.tsx), visiting a page whose canonical slug contains non-ASCII characters (e.g. Chinese) shows Notion page not found, even when the page exists in the site map and appears correctly on the home page.
ASCII-only slugs work fine.
Cause
params.pageId from the App Router can still be percent-encoded for non-ASCII path segments. That value is passed into resolveNotionPage and used as a key into canonicalPageMap:
const overridePageId = canonicalPageMap[rawPageId]The map keys are decoded/canonical slugs, so encoded lookups miss and the page is treated as missing.
Steps to reproduce
Use a Notion site with at least one page whose slug is non-ASCII (e.g. Chinese title → Chinese slug). Open that page via its slug URL (not the UUID). Observe "Notion page not found". Open an ASCII-only slug page on the same site → works.
Expected
Slug URLs with non-ASCII characters resolve the same way as ASCII slugs.
Suggested fix
Decode the path param before UUID / canonicalPageMap lookup, e.g. decodeURIComponent on rawPageId (with a safe try/catch for malformed sequences) in resolveNotionPage (or at the app/[pageId]/page.tsx boundary).
I hit this on a fork after moving to the current App Router stack and fixed it locally by decoding before lookup. Happy to open a small PR if useful.
Environment
Upstream main (App Router / Next 15+) Reproduced with Chinese slugs; ASCII slugs unaffected
Source: transitive-bullshit/nextjs-notion-starter-kit