Recoil: Duplicate atom key warning when used from multiple bundles
For 0.0.8, I am getting the following blocking error (was working fine with 0.07):
recoil.development.js:117 Uncaught TypeError: Cannot destructure property 'error' of 'undefined' as it is undefined.
Two issues afaics:
- It displays the wrong error, since there isnt a third parameter in the call from registerNode: https://github.com/facebookexperimental/Recoil/blob/22b42bbc0366bf748b4265735eb4b6c90c90ff1f/src/core/Recoil_Node.js#L84
- The actual error (Duplicate atom key …) it wants to display is not correct, since I have only one of this key registered (it is not duplicated), however the package is called from two bundles.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 6
- Comments: 15 (2 by maintainers)
Recoil
withNextJS
. This happens every time I try refresh with new page.I think it might be HMR problem because it happened on development only, but I want to know how I do a singleton pattern for
atom
to prevent this warning on development.Thanks!
I am using hmr however the error shows without hmr being invoked (no files are changed, just loading the app generates the error)