You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a usecase where I have a main /account url. For non-mobile users (breakpoints measured client side) I need to redirect them to /account/details when that page initially renders and the client side code hydrates.
I get an error message in the console that says " Route /account/details does not exist"
If I manually reload the /account/details page it works.
If I do a 302 redirect from the server loader it works, but I can't determine the mobile or non-mobile from within that code.
This client-side navigate worked previously in Remix 2.x before my upgrade to React Router v7.
My assumption is that the Fog of War has caused the /account/details to be removed from the manifest until it detects that a user is about to visit that page.
I debugged into the react-router code and see that the route matches only contains my / and /account route while it's attempting to programmatically navigate to that /account/details so it fails navigation with that missing route error.
I would expect the React-Rotuer client-side redirecting libraries to work with the manifest check even if the path I'm redirecting to had not yet been loaded by fog of war
Actual Behavior
I get this error with either a <Navigate or useNavigate from the initial render of this page.
hook.js:600 No routes matched location "/account/details" Error Component Stack
at DataRoutes (chunk-SYFQ2XB5.mjs:4902:3)
at Router (chunk-SYFQ2XB5.mjs:4987:13)
at RouterProvider (chunk-SYFQ2XB5.mjs:4732:3)
at RouterProvider2 (<anonymous>)
at RemixErrorBoundary (chunk-SYFQ2XB5.mjs:5931:5)
at HydratedRouter (dom-export.mjs:147:46)
at DefaultPropsProvider (DefaultPropsProvider.js:9:3)
The text was updated successfully, but these errors were encountered:
I'm using React Router as a...
library
Reproduction
I have a usecase where I have a main
/account
url. For non-mobile users (breakpoints measured client side) I need to redirect them to/account/details
when that page initially renders and the client side code hydrates.Inside the component:
Inside a client loader, same problem
I get an error message in the console that says " Route /account/details does not exist"
If I manually reload the
/account/details
page it works.If I do a 302 redirect from the server
loader
it works, but I can't determine the mobile or non-mobile from within that code.This client-side
navigate
worked previously in Remix 2.x before my upgrade to React Router v7.My assumption is that the Fog of War has caused the
/account/details
to be removed from the manifest until it detects that a user is about to visit that page.I debugged into the react-router code and see that the route
matches
only contains my/
and/account
route while it's attempting to programmatically navigate to that/account/details
so it fails navigation with that missing route error.System Info
Used Package Manager
npm
Expected Behavior
I would expect the React-Rotuer client-side redirecting libraries to work with the manifest check even if the path I'm redirecting to had not yet been loaded by fog of war
Actual Behavior
I get this error with either a
<Navigate
oruseNavigate
from the initial render of this page.The text was updated successfully, but these errors were encountered: