Closed dolie closed 7 months ago
In which environment are you using signals? Is it react or preact? Which bundler are u using? Vite? Webpack? If it's react and vite - you can try out my react integration - I've tested it for this case (it happens while component recursive rerender itself)
You need to provide an actual minimal reproduction, poorly cropped screenshots are far from adequate for helping us to help you.
Hello @XantreGodlike, Thank you for your fast reply. 🚀 I resolved the error.
For posterity :
Env : Preact & Vite & SWR
I suspected that useSignalEffects
were re-triggered by the _mutate
.
So, I disabled all useSignalEffect
(effects A,B & C) of page's components.
Effect C
was so small and did not have much interactions with the two others. So I reactivate it. Keeps running ✅
A
and B
were both watching the mutated signal.
I decided to merge those into one useSignalEffect
, and it corrected the all thing. ✅
useSignalEffect are powerful, but errors are difficult to track down... there were no clues between _mutate
and those useSignalEffects... also "Out-of-order effect" is not really meaningful.
Also, if you know an eslint plugin that report cyclic dependencies in useSignalEffect, I am really interested. 🤓
Thank you again for your fast reply and for your work 🔥.
Hello 👋,
I got this error, may you help me understand where the problem is ? 🙏
This error occurs when I click a button to trigger some async calls. I don't see any cyclic dependencies... And don't really understand the error, and why it occurs...
Error & Callstack :
Files associated with callstack