-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
middleware (stable version) matcher conflict with some rewrites/redirects #39531
Comments
Up. 🙂 |
According to @mlake (here), using Vercel, the issue happens even with a very simple middleware without any matcher...
|
Any chance PR #45504 would relate to this? |
Yes, you are right, thanks. I cannot reproduce the full bug with canary version. async redirects() {
return [
{
source: '/fr/about',
destination: '/fr/a-propos',
locale: false,
permanent: false,
},
]
}, So |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
What browser are you using? (if relevant)
Firefox Developer Edition 98.0b10 - Firefox 97.0.2 - Chromium 99.0.4844.51
How are you deploying your application? (if relevant)
yarn dev OR yarn build && yarn start
Describe the Bug
Here is my next config:
Without any middleware, or with a middleware without
matcher
config, everything works as exected.But if I add this config,
{ matcher: ['/about'] }
to the middleware, then the/fr/a-propos
page is broken on CSR: the props from getStaticProps are not received by the page because there is a wrong redirection, from/_next/data/development/fr/about.json
to/fr/a-propos
.Expected Behavior
The middleware should not conflict with the rewrites/redirects.
Link to reproduction
Repo Github
Repo on CodeSandbox
CodeSandbox deployment
To Reproduce
yarn install
yarn dev
oryarn build && yarn start
http://localhost:3000/
Visit /fr/a-propos
link/_next/data/development/fr/about.json
to/fr/a-propos
.The text was updated successfully, but these errors were encountered: