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
This issue also happens in this very simple case :
Create a remix app with npx create-remix@latest
Create a valid page such as export default function TestPage() { return <div>Test</div>; }
In _index.tsx, add useEffect(() => { navigate("/test"); }, []);
Get a 404, with this error message in the console
Refresh the page and get actual page
Note : if navigate(...) is wrapped in a function called on a button click, it works.
EDIT : The issue only happens when running the project with npm run dev. After using npm run build & npm run start, it works fine.
EDIT2 : After disabling Strict Mode, it works fine with dev as well.
We're seeing the same issue when a nav-link is clicked right after the HTML has been rendered. This is hard (but possible) to reproduce manually, but happens consistently in Playwright tests that automate the clicking.
As noted by @maximeclaisse, the issue disappears when strict mode is disabled.
Reproduction
I'm doing a redirect in a AuthLayout (AuthLayout.tsx) according if session is true/false
And when navigating to /login I have a 404 error
Small reproduction : https://github.com/srod/remix-v3_lazyRouteDiscovery
If you go with your browser to /protected you will have that 404
Error:
No routes matched location "/login"
ErrorResponseImpl {status: 404, statusText: 'Not Found', internal: true, data: 'Error: No route matches URL "/login"',
Discord link if needed: https://discord.com/channels/770287896669978684/1306915010701824063
System Info
Used Package Manager
npm
Expected Behavior
Navigate to /login without 404 error.
Actual Behavior
When navigate to /login we have an error.
The text was updated successfully, but these errors were encountered: