-
Notifications
You must be signed in to change notification settings - Fork 26.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Middleware in Page Router causes 200 responses on prefetch or Next/Link for missing pages, and missing GetStaticProps on page nav #56222
Comments
There's a large series of items related to middleware.ts file simply existing and pages router - anyway to get eyes on it?
and more... |
Any way to get this looked at? This has been a major hold up on a few of our initiatives and is clearly broken in pages router when using any middleware. |
@ijjk normally I don't tag maintainers, so sorry for doing so, but I've seen a lot of similar issues to this one in the issue list, and this is pretty clearly broken/reproable (including in latest canary) and is currently blocking a project we are on. Any chance we can get some eyes on it? I've collated a list of (at least these) related tickets here: #50212 (comment) |
Link to the code that reproduces this issue
https://github.com/broksonic21/next-404
To Reproduce
In Dev mode:
npm run dev
In prod:
npm run build;npm run start
To see how it should work: for either dev or build/start:
OR
Note: issue started here: v13.4.12...v13.4.13-canary.0 - it doesn't repro in v13.4.12, and does repro in v13.4.13-canary.0 and beyond, up until current canary
Current vs. Expected behavior
Links to missing pages should go to a 404 with or without a middleware using page router, especially if the middleware doesn't match the route anyway.
See reproduction for details
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
Middleware / Edge (API routes, runtime), Routing (next/router, next/navigation, next/link)
Additional context
I have tested against all released versions since v13.14.12, including latest canary - the issue started in v13.4.13-canary.0 and continues until today.
The text was updated successfully, but these errors were encountered: