TanStack / router

🤖 Fully typesafe Router for React (and friends) w/ built-in caching, 1st class search-param APIs, client-side cache integration and isomorphic rendering.
https://tanstack.com/router
MIT License
7.19k stars 486 forks source link

Navigating between routes returns notFoundComponent #1538

Closed ziongh closed 2 weeks ago

ziongh commented 2 weeks ago

Describe the bug

When using the router and navigating from the base address into the child routes, the system behaves as expected.

But when we open the browser into a specifc route and then navigates to another route, the router returns the component of notFoundComponent.

Your Example Website or App

https://github.com/ziongh/example-farm-tanstack-reatom

Steps to Reproduce the Bug or Issue

  1. Go to http://localhost:9000/dashboard/todo
  2. On the left menu click on the menu "About/About 1"
  3. You will see that it appears "Dashboard Not Found" (the component of notFoundComponent).

Expected behavior

As a user, I would expect the route to open normally.

Screenshots or Videos

No response

Platform

Additional context

No response

SeanCassiere commented 2 weeks ago

Your example app is not loadable in Stackblitz for us to observe and assess the behaviour described.

Please add a minimal reproducible example for us to be able to correctly observe what's happening. You can create a minimal example using the Router file-based stackblitz starter.

Here are some guidelines you can follow when creating a minimal reproducible example: https://stackoverflow.com/help/mcve

ziongh commented 2 weeks ago

That's because I'm using Farm that is written in rust, and Stackblitz does not support native code.

However you can use the github codespace to run the code (pnpm install then pnpm start). Or build on your local machine too.

I can make a different branch using Vite instead of farm, but the result is the same.

image

SeanCassiere commented 2 weeks ago

Similar to my comment here, the reproducible example needs to be just enough to recreate the error, without all extra dependencies, unneeded code, and other fluff.

ziongh commented 2 weeks ago

Sorry about that, It seems that the error reported here (and here: #1539) is related to using preact instead of react.

SeanCassiere commented 2 weeks ago

@ziongh ahhhh, understood. Closing for now.

If you run into this again using React, and want to reopen this issue ping me here, or simply create a new issue referencing this issue.