Troubleshooting
1. Can't find needed effect inside createSaga?β
The plugin might not be connected properly. Try to check Plugin basics, and how to merge plugins.
2. Effect not working?β
There could be a mismatch in using await
with effects. Try to check the api reference for more information. Note that there are:
- Effects typically called with
await
, like take, call, or delay. - Effects called without
await
, like select, fork, or spawn.
3. Can't catch an error?β
Using sagas in a non-blocking way (without await
) can result in difficulties catching errors outside such effect calls. Try to check non-blocking calls error handling.
4. Getting an 'Aborted' error in try..catch?β
Cancellation is implemented by throwing an error (specifically, an AbortError), and it can be performed manually (via cancel effect calls) and automatically (for instance, useSaga calls cancel on React component unmount as well).
5. Saga not getting cancelled instantly?β
Sagas get cancelled through the effects you use. This usually works well since many effects call this.throwIfCancelled under the hood. However, large synchronous blocks of code without effect calls inside cannot be aborted during their execution, except manually. Check the error handling recipes, which suggest using effects more frequently. For further details, see this.throwIfCancelled.
Tell us about your problemβ
Feel free to create an issue on GitHub.