-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Navigation fails due to missing manifest (fog of war enabled) #10397
Comments
I think one way you could work around this is by using a state and explicitly navigating when state is different from active tab: if (tab !== activeTab) {
const pathname = tab === tabNames.active ? "/conversations" : "/conversations/archived";
navigate(pathname);
} |
Fixed by #10447 |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
Reproduction
In our codebase we have the following (buggy) component
When a
Tab
is clicked,onChange
fires and causes a navigation. It is buggy because the navigation triggers a re-render of this component (due to the usage ofuseLocation
), which calculates a newtabIndex
which causesonChange
to be fired again, causing a new navigation (to the same route).While most of the time this behavior doesn't cause any problems, on slower networks (I'm throttling my network) it causes the navigation to fail. I tried to do some debugging and my understanding is that the second navigation event causes the first to be aborted, which leads Remix to cancel the loading of the manifest and navigate to the incorrect route
Note: I realize this is far from being a great bug report but not being familiar with how the Remix internals work I struggle to provide better details or even to find the right way to reproduce it - happy to share more details or even jump on a call to show what we experience
System Info
Used Package Manager
npm
Expected Behavior
Navigation should work without throwing (even if the buggy code I shared above)
Actual Behavior
Remix believes it has all available "matches" but ends up navigating to the wrong route, which throws the following error
Route "routes/_index+/conversations+/$conversationId+/_layout" does not match URL "/conversations/archived"
The text was updated successfully, but these errors were encountered: