Skip to content
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

The TanStack Store React quick start page has too many redirects #129

Closed
richardtknight opened this issue Dec 23, 2023 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@richardtknight
Copy link

Describe the bug

The link to "quick start" doesn't load anything, and if you open it in a new tab, eventually it resolves into an ERR_TOO_MANY_REDIRECTS error being thrown as per the screenshot attached.

Your Example Website or App

https://tanstack.com/store/latest/docs/framework/react/quick-start

Steps to Reproduce the Bug or Issue

  1. Go to the TanStack store documentation overview page
  2. Click "Quick Start" in the left hand menu
  3. Wait...

Expected behavior

As a user I expected the quick start page to load.

Screenshots or Videos

Screenshot 2023-12-23 at 16 20 25

Platform

  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Version: [e.g. 91.1]

Additional context

No response

@crutchcorn crutchcorn transferred this issue from TanStack/store Dec 31, 2023
@crutchcorn crutchcorn added the bug Something isn't working label Jan 9, 2024
@fulopkovacs
Copy link
Contributor

fulopkovacs commented Jan 12, 2024

#133 will fix this (See this comment).

Basically, the example routes are not set up correctly. When the user loads /store/latest/framework/react/quick-start it matches the store.$version.docs.framework.$framework.$examples._index.tsx route, where $examples is a dynamic segment.

Note

These are the values of the route params: {version: "latest", framework: "react", examples: "quick-start}`

The problem is that this is the loader of store.$version.docs.framework.$framework.$examples._index.tsx:

export const loader = (context: LoaderFunctionArgs) => {
  throw redirect(context.request.url.replace('/examples/', `/examples/simple`))
}

Since context.request.url does not contain '/examples/', it'll just redirect the route to itself. This is where the infinite redirects come from.

The solution is simply to drop the $ from $examples in examples' routes:

  • app/routes/store.$version.docs.framework.$framework.$examples._index.tsx -> app/routes/store.$version.docs.framework.$framework.examples._index.tsx
  • app/routes/store.$version.docs.framework.$framework.$examples.$.tsx -> app/routes/store.$version.docs.framework.$framework.examples.$.tsx

I think it's just a typo, because the form routes already look like the fixed version.

@crutchcorn
Copy link
Member

Closed, as @fulopkovacs's work is merged! Thank you!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants