-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[Bug]: When using unstable_useBlocker, the console logs "A router only supports one blocker at a time" #10073
Comments
Duplicate of #9978 |
@timdorr The example I provided uses a single blocker, not multiple. It works fine with 6.8.0, the warning is logged only when using 6.8.1. |
Same here, we use a single blocker on a page, and we are getting this warning in 6.8.1 (not appearing in 6.8.0) So I wonder if the lib change the way it detect it and there is an issue in our app, of the warning should not be triggered. |
Oh geez, I totally mis-read your issue. My apologies for that. This looks legit, so opening it back up... |
This seems potentially related to (or the same as) #10144. If I use the linked stackblitz here but remove It looks like |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
#10573 should fix |
This will be available in |
Thanks for the update @brophdawg11 |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
After updating to latest version, I get the following error:
No more details and the error it's getting fired every ~second |
@enoh-barbu I reckon it is worth opening another issue with details, especially if you have a self-contained example where the error can be reproduced. We have the same problem after upgrading to 6.14.0 and we had to downgrade back to 6.8.0. |
@bartelemi so if you also have the same problem, should I still open a new issue? |
I think so |
This is tracked in remix-run/remix#6704 but right now you should wrap your blocker function in a |
This is still happening to me. What's worse 6.13.0 works well regarding blocking and displaying UI prompt. However, update to 6.14 / 6.15 (without any code change) causes this warning and blocker is probably not cleared which causes navigation not to work later. It seems like router is not update / re-rendered and still takes the blocker which should be already removed. |
@kubmir same issue, getting confirm window twice, and after leaving the page I can see confirm error for every single page change, and I don't have useBlocker there. |
Please file a new issue with a minimal reproduction of the issue and we can take a look. |
same issue with 6.22.0 downgrade to 6.8.0 works well. I am with viteJS |
Hello @vasile-encord did you find any solution ? We had to update to 6.22.0 and it is still not working. It is broken for any version newer than 6.13.0 for me. It looks like redirect work for a second but than the original page is displayed and the warning is triggered. |
What version of React Router are you using?
6.8.1
Steps to Reproduce
(basically it's the same example found here https://github.com/remix-run/react-router/tree/main/examples/navigation-blocking but using version 6.8.1)
Expected Behavior
No warnings in the console.
Actual Behavior
Console logs a warning "A router only supports one blocker at a time".
The text was updated successfully, but these errors were encountered: