open-next icon indicating copy to clipboard operation
open-next copied to clipboard

Hitting a non-existent route results in infinite redirect. Same app behaves correctly locally and on vercel.

Open ilyastam opened this issue 10 months ago • 4 comments

I have a nextjs app on v14, it uses page routing. when I enter a non-existent route (/foobar) - the app 308 redirects to /404/ few dozen times, and then browser cancels the request.

Same app works fine when ran locally with npm run dev or on vercel.

Here is the link to a version deployed with sst: https://d2ia2gbaq4gtdc.cloudfront.net/ Working version on vercel: tripyacht.com

This is the only thing thats stopping me from fully embracing open next, and migrating away from Vercel.

ilyastam avatar Apr 20 '24 23:04 ilyastam

Hi can you specify the open-next version and exact next version? Can you also set up a min repo?

According to the latest versions pages: https://dqijpnhzoveol.cloudfront.net/foo app: https://d1rjbhcyvwj9a2.cloudfront.net/foo

They both redirect to 404 and does not have an infinite redirect.

khuezy avatar Apr 21 '24 00:04 khuezy

Thanks!

Next.js v14.2.1 OpenNext v2.3.7

Sorry, not sure what is "min repo", could you please elaborate?

ilyastam avatar Apr 21 '24 21:04 ilyastam

A minimum reproduction project on github so we can see what's causing the issue.

khuezy avatar Apr 22 '24 00:04 khuezy

@ilyastam can you try upgrading next to 14.2.2, according to the test, it passes: https://discord.com/channels/983865673656705025/1027265626085019769/1230685589926576309

But there might be some edge case in your setup that's causing the infinite loop that we haven't covered. We'll need a reproduction.

khuezy avatar Apr 22 '24 00:04 khuezy

I'm going to close this old issue. If that's still an issue, reopen and provide a reproduction

conico974 avatar Sep 28 '24 11:09 conico974