Open Kamahl19 opened 1 year ago
Hi, it looks like the error is happening on useRecoilCallback
, apparently when first invoked it can't find the context.
Which versions of Recoil and Recoil Nexus are you using?
@luisanton-io Thanks for getting back to me. I use the latest recoil and latest nexus
Could be similar to this?
@luisanton-io Here is the codebase I am using it in https://github.com/Kamahl19/react-starter . I am wrapping the whole application in RecoilRoot
in https://github.com/Kamahl19/react-starter/blob/c568c273875fad3a5a8058f2c4f396cb041293d8/src/app/providers/Recoil.tsx#L17 which is used in https://github.com/Kamahl19/react-starter/blob/c568c273875fad3a5a8058f2c4f396cb041293d8/src/app/Root.tsx#L17 and https://github.com/Kamahl19/react-starter/blob/c568c273875fad3a5a8058f2c4f396cb041293d8/src/tests/utils.tsx#L34
In this commit I have updated to latest Vitest but had to stop using Nexus and partly copy-paste its functionality https://github.com/Kamahl19/react-starter/commit/c568c273875fad3a5a8058f2c4f396cb041293d8
Weird, I also ran into this when migrating from jest to vitest. I'm not at all sure what would cause this, I have a recoil root in my test, and it worked fine under jest. The only thing I can think is that I'm also migrating my package to ESM at the same time, probably something about loading this package (which appears to be commonjs) in an ESM package is somehow broken.
After upgrading from Vitest 0.31.4 to 0.32.0 I am getting