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

notFound(), route loader, and initial application loading. #1437

Closed
kisonay opened this issue Apr 6, 2024 · 5 comments
Closed

notFound(), route loader, and initial application loading. #1437

kisonay opened this issue Apr 6, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@kisonay
Copy link

kisonay commented Apr 6, 2024

Describe the bug

Following the documentation I was able to setup a dynamic route, load some data, and if something doesn't exist, display not found.

This works as expected when navigating throughout the app (using the router). but once I refresh on a known-broken item, the default not found component does not render but the error component does.

Your Example Website or App

https://stackblitz.com/edit/github-3cnvav?file=src%2Froutes%2F__root.tsx,src%2Froutes%2F%24type.%24id.tsx

Steps to Reproduce the Bug or Issue

Navigate to each tab on render. you will see that unknown shows as not found.

now, in the address bar (above the render,) append /unknown/idthe application will reload and show the error component.

Expected behavior

I would expect not found to show once the application loads

Screenshots or Videos

No response

Platform

  • latest macOS
  • Brave/Chrome
  • tanstack router v. 1.26.11

Additional context

If an activity/id exists and a user bookmarks/saves the url, if they go back and it no longer exists, i would expect them to see the appropriate not found message, not an error.

@GuillaumeLaroucheUQAT
Copy link

GuillaumeLaroucheUQAT commented Apr 15, 2024

I have the same issue but only if I set the value 0 to defaultPendingMs when configuring the router instance.

@tannerlinsley
Copy link
Collaborator

Try again with the version I just released today?

@kisonay
Copy link
Author

kisonay commented Apr 16, 2024

Try again with the version I just released today?

seeing the same behavior locally with 1.28.1

@schiller-manuel
Copy link
Contributor

please try again with https://github.com/TanStack/router/releases/tag/v1.28.2

this is the release Tanner referred to but was not released until now

@SeanCassiere SeanCassiere added the bug Something isn't working label Apr 18, 2024
@SeanCassiere
Copy link
Contributor

Re-tested with 1.28.7 and can confirm the original issue has been resolved.

Sandbox: https://stackblitz.com/edit/github-3cnvav-e5bwfj?file=src%2Froutes%2F%24type.%24id.tsx

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

5 participants