Skip to content

Infinite loop when accessing certain routes directly #1346

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

Closed
mcmxcdev opened this issue May 5, 2021 · 4 comments
Closed

Infinite loop when accessing certain routes directly #1346

mcmxcdev opened this issue May 5, 2021 · 4 comments
Labels

Comments

@mcmxcdev
Copy link
Contributor

mcmxcdev commented May 5, 2021

Describe the bug
I was made aware of a user of my website that there is a nasty infinite loop occuring: https://github.com/mhatvan/markushatvan.com/issues/17

The infinite loop ONLY occurs on the pages /blog, /tags and /categories when accessing it directly on markushatvan.com
For example: markushatvan.com/tags fails while markushatvan.com/about works.

If you check the screenshot that I attached, these are exactly the three url slugs that are outputted from @sveltejs/adapter-static which get processed to do a 301.

To Reproduce
I was not able to reproduce this locally with a dev or prod build, it seems to occur in combination with Netlify deployment on actual production.

Expected behavior
All pages are working without infinite loop.

Information about your SvelteKit Installation:

Diagnostics
  • Your browser: Brave Browser 1.23.75

  • Your adapter (e.g. Node, static, Vercel, Begin, etc...): adapter-static

Severity
Bad, since users can't acess certain links.

Additional context
Screenshot 2021-05-05 at 20 35 31

@babichjacob
Copy link
Member

Possibly related to #733

@benmccann
Copy link
Member

It's hard to know what might be occurring here without a reproduction. Do you have code that you can share?

@mcmxcdev
Copy link
Contributor Author

mcmxcdev commented May 6, 2021

The whole repo is open source, this is one of the routes: https://github.com/mhatvan/markushatvan.com/tree/master/src/routes/categories

I could imagine what happens is that SvelteKit removes the trailing slash while Netlify wants to add a trailing slash, ending up in an endless redirect.

@benmccann
Copy link
Member

Ah, yeah, it looks like Netlify adds a trailing slash: https://docs.netlify.com/routing/redirects/redirect-options/#trailing-slash. You might try turning off their Pretty URLs feature to see if it fixes it for you

I'll close as a duplicate of #733

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants