Repository navigation
Conversation
abort() without a reason creates a default AbortError, which can show up as an uncaught rejection when React StrictMode remounts and runs the registration cleanup. Pass a cleanup reason and cover the remount with a test.
|
Thanks for looking into this, @beaufortfrancois, and sorry for the noise. I missed that #16 already covered this. I was testing against the published 0.3.0 from npm, which doesn't include #16 yet, so in Chrome I could still see the uncaught For next time: is installing straight from the repo ( |
|
No worries at all! Yes, installing from GitHub is the way to go for now. There are no preview builds as the package has no build step. npm install github:GoogleChromeLabs/use-webmcp-tool
# or pin a specific commit:
npm install github:GoogleChromeLabs/use-webmcp-tool#<commit-sha>We'll cut a new release that includes #16 soon™️ |
Fixes #19
React StrictMode runs the registration effect's cleanup on the first mount, which aborts the
registerToolsignal. Callingcontroller.abort()with no argument creates a defaultAbortError("signal is aborted without reason"), and that can show up as an uncaught rejection even though the hook already ignores aborted registrations in its own state.This passes a cleanup reason to
abort()so the defaultAbortErroris never created, and adds a StrictMode test that fails if an uncaughtAbortErrorleaks.npm test: 37 passing.