Encoded slashes not working as expected in production in a catch-all route
See original GitHub issueWhat version of Next.js are you using?
10.0.2
What version of Node.js are you using?
14.16.1
What browser are you using?
Firefox & Brave
What operating system are you using?
Ubuntu Linux
How are you deploying your application?
Vercel
Describe the Bug
My application is using a catch-all route which tests that the slug length is 3 or less and returns notFound
if other. The last slug part has an arbitrary content, including another slashes, but it’s encoded using encodeURIComponent
so it doesn’t get to conflict with the catch-all filter.
Locally, everything works correctly, but in production (in Vercel) breaks when using slashes, as reported in TheDavidDelta/lingva-translate#18. I’ve tested this issue reports and it’s not only in links but in everything that contains a slash i.e. https://lingva.ml/en/es/like %2F dislike, even though locally it works great (fell free to clone that repo to test it).
Expected Behavior
To don’t break nor send 404 when using encoded slashes on filtered catch-all routes, as works locally.
To Reproduce
Go to https://lingva.ml and write any translation that contains a slash.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Sorry for the late reply @ijjk.
Thanks for your help. I’ve just tested it out and it seems to work perfectly. Here’s my previous example and this is the same URL working on the updated preview branch. I’ve also tested the example from the guy that opened the issue in my repo as well as its current behaviour.
I think it’s ready to merge. Thanks again.
Regards, David.
Hi, this should be fixed in
v11.0.2-canary.6
of Next.js, please upgrade and give it a try!