-
Notifications
You must be signed in to change notification settings - Fork 901
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
Fix regex page matcher for Next.js middlewares version 1 #5496
Fix regex page matcher for Next.js middlewares version 1 #5496
Conversation
Are there any other Next 12 gotchas? E.g, rewrites/redirects/headers? |
I can check but I don't think so. Middlewares was still in beta before Next.js 12.2 so that was the main thing we're dealing with that has changed |
Add changelog |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #5496 +/- ##
==========================================
+ Coverage 55.20% 55.23% +0.02%
==========================================
Files 328 328
Lines 22410 22415 +5
Branches 4573 4574 +1
==========================================
+ Hits 12372 12381 +9
+ Misses 8936 8932 -4
Partials 1102 1102
☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please write a test to "prove" this addresses the mismatch middleware issue.
* fix regex matcher for middleware version 1 * MiddlewareManifest type * changelog * get middleware matcher regexes as util + unit tests * prettier in changelog
* fix regex matcher for middleware version 1 * MiddlewareManifest type * changelog * get middleware matcher regexes as util + unit tests * prettier in changelog
Description
Projects using the first version of the Next.js middleware were failing to deploy due to a difference in
middleware-manifest.json
. The first version was in Next.js until v12.1.6. Version 2 was introduced in Next.js 12.2.0. This PR handles the middleware page matchers for version 1.Scenarios Tested
Sample Commands