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
Different behaviour for urls with and without trailing slash #686
Comments
Thanks @donni106! I'm assuming this works fine with plain Next.js. And judging by the Prisma error, it looks like maybe there is a bug with our Someone just needs to dig into this a bit and find the root cause :) |
This is possible for the error with e.g. But for the 404 on |
Ok yeah I haven't dug into it. I'm currently focused on authentication, so hopefully someone else can look into this :) |
Yeah I think this is a Next problem, not a Blitz problem. In this Next Sandbox, |
Update: looks like it’s being fixed! vercel/next.js#5214 (comment) |
This has now been fixed in Next, so I’m closing this. If you see the Sandbox I linked above, I’ve updated Next to the latest version, and the routes now seem to work correctly. Please feel free to open again if this problem persists! |
What is the problem?
I found out, that I can acces the index page http://localhost:3000/projects but not the same page with a trailing slash http://localhost:3000/projects/, which results in a 404.
Similar with http://localhost:3000/projects/new everything is fine, but http://localhost:3000/projects/new/ results in an error.
Steps to Reproduce
http://localhost:3000/projects
-> works finehttp://localhost:3000/projects/
-> not foundhttp://localhost:3000/projects/new
-> works finehttp://localhost:3000/projects/new/
-> errorVersions
Other
There are inconsistancies across routes regarding trailing slashes. Some routes work with both versions, others not.
How should urls behave with and without trailing slashes in general?
Here is a blog post about the topic for further read: https://searchfacts.com/url-trailing-slash/
Found something next.js related here: https://stackoverflow.com/questions/57005120/how-can-you-handle-trailing-slashes-in-next-js-routes
In nextjs docs: https://nextjs.org/docs/api-reference/next.config.js/exportPathMap#adding-a-trailing-slash
Issue in nextjs repo: vercel/next.js#5214
The text was updated successfully, but these errors were encountered: