You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Navigate to any todo on the index page after the 5th ID.
It should route to the 404 page.
Rename the middleware2.ts file to middleware.ts.
Repeat Step 2.
This will result in an application error.
Current vs. Expected behavior
Current Behaviour:
With Middleware dynamic not found pages throws application error
Expected Behaviour:
With Middleware dynamic not found page should navigate to 404 page
Verify canary release
I verified that the issue exists in the latest Next.js canary release
Provide environment information
NA
Which area(s) are affected? (Select all that apply)
Middleware / Edge (API routes, runtime)
Additional context
Since Next 12, I have been experiencing issues with routing to the 404 page on dynamic pages when using middleware. I am attempting to render 404 pages when a path does not exist. However, when I enable middleware, it throws an application error instead of routing to 404. Interestingly, when I remove the middleware, the routing works as expected.
This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.
This issue has been automatically closed due to two years of inactivity. If you’re still experiencing a similar problem or have additional details to share, please open a new issue following our current issue template. Your updated report helps us investigate and address concerns more efficiently. Thank you for your understanding!
Link to the code that reproduces this issue
https://codesandbox.io/p/sandbox/beautiful-dawn-7r9q24
To Reproduce
Current vs. Expected behavior
Current Behaviour:
Expected Behaviour:
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
Middleware / Edge (API routes, runtime)
Additional context
Since Next 12, I have been experiencing issues with routing to the 404 page on dynamic pages when using middleware. I am attempting to render 404 pages when a path does not exist. However, when I enable middleware, it throws an application error instead of routing to 404. Interestingly, when I remove the middleware, the routing works as expected.
The text was updated successfully, but these errors were encountered: