hozana / next-translate-routes

Flexible and translated routes for Next.js without custom server
MIT License
116 stars 30 forks source link

Routing does not work any more after update to next 13.3.0 #68

Closed dsm-ostec closed 1 year ago

dsm-ostec commented 1 year ago

Hey there,

I use the package and it worked great, but after update to next 13.3.0 the redirects doesn't seem to work anymore.

With debugging, I see a correct infos I think:

image

but when I click on a translated link I always get an 404. With non translated links the redirect works correct.

Aftre I installed next version 13.2.4 again it works like a charm again.

Can you please have a look at this?

Kristijan007v commented 1 year ago

I can confirm this as well, having same issues, rollback to next version 13.2.4 helped.

cvolant commented 1 year ago

I don't reproduce the issue... Can you first try next-translate-routes@1.10.1, then, if you still have the issue, tell be more about it? Logs, behavior, etc. If you can provide a minimal reproduction, that would help a lot.

dsm-ostec commented 1 year ago

I tried with next v13.3.0 and next-translate-routes@1.10.1. Nothing changed. I deleted yarn cache and my complete node-modules-folder but this doesn't change anything.

The redirects and rewrites I get in the log seems to be fine and the redirects still work. Just the rewrites are not working anymore. If I write one of the rewrite-rules from the log directly in the next-config, this redirect works. I will try to create a sandbox for this issues to reproduce.

dsm-ostec commented 1 year ago

https://codesandbox.io/p/sandbox/affectionate-violet-422vgg?welcome=true

I created a sandbox-example. There the url "blog/:slug" is a translated path and should be reachable with /blog/test, /en/bloggy/test and /it/bloggo/test.

But if you try, only the /blog/test oder /en/blog/test or /it/blog/test will lead to the page. The other urls will lead to 404. Maybe I just configured something wrong?

cvolant commented 1 year ago

Interesting! Thanks for the reproduction @dsm-ostec! I reproduce it only using next dev, not using next build && next start. Using next@13.2.4, next-translate-routes@1.10.0 does not compile because of the missing property in redirects :disappointed:, but if I remove this prop, it works all good. So it seems to be a bug in next introduced with the 13.3.0. Maybe the same as this issue.

dsm-ostec commented 1 year ago

Thank you for the quick help. Works great again. :)

cvolant commented 1 year ago

Yes, I used the workaround mentioned in the aforementioned issue. Thanks you @jaapaurelio.