mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #251] Support pageExtensions config for .mdx page routes #62
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#62
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @southpolesteve on GitHub (Mar 4, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/251
Problem
The App Router route scanner hardcodes the file extensions it looks for when discovering page routes:
This means
.mdxfiles used directly as page routes (e.g.,app/blog/page.mdx) are not recognized. The route scanner skips them and the route returns 404.Next.js supports a
pageExtensionsconfig option innext.config.jsthat lets users add custom extensions likemdx:Current behavior
page.tsxthat doesimport Content from "./content.mdx"renders correctly (vinext auto-injects@mdx-js/rollupand the proxy plugin handles transform ordering).app/about/page.mdxreturns 404 because the route scanner never finds it.Expected behavior
When
pageExtensionsincludes"mdx"(or vinext auto-detects MDX files), the route scanner should glob for**/page.{tsx,ts,jsx,js,mdx}and register.mdxfiles as valid page routes.Files that need changes
packages/vinext/src/routing/app-router.ts(line 127): extend the glob patternpackages/vinext/src/routing/pages-router.ts: same for Pages Router file scanningpackages/vinext/src/config/next-config.ts: readpageExtensionsfrom next.config.jsReferences
@illegalcall commented on GitHub (Mar 5, 2026):
Picking this up.
@illegalcall commented on GitHub (Mar 5, 2026):
Created a PR @southpolesteve