saasquatch / bunshi

Molecule pattern for jotai, valtio, zustand, nanostores, xstate, react and vue
https://www.bunshi.org/
MIT License
218 stars 16 forks source link

Firefox error after 2.0.2 #48

Closed alexlag closed 7 months ago

alexlag commented 7 months ago

In Firefox with bunshi@2.1.1 there is an error with WeakSet add calls.

That might be because of Firefox not supporting non-registered symbols as keys.

loganvolkers commented 7 months ago

Thanks for the bug report!

We'll look at turning on Browser Mode in vitest reproduce and confirm this issue.

loganvolkers commented 7 months ago

Reproduced this with Browser Mode in vitest on the browser testing branch already. Looks like Firefox doesn't support non-registered symbols as keys in both Weakmap and Weakset.

This looks like it was introduced with the changes to lifecycle in 2.1.x

There should be a backwards-compatible fix. Will look to patch in 2.1.2 as a hot fix.

loganvolkers commented 7 months ago

Thanks for the report @alexlag - this has now been fixed and released in v2.1.2

Github actions to do automatic native in-browser testing have been added in #49 so that these kinds of regressions don't happen in the future.