Using takeEvery from redux-saga/effects causes TypeError: Cannot read property 'next' of undefined
See original GitHub issueIn the latest version of redux saga (^0.16.0) I was getting a console warning about how importing takeEvery
from redux-saga
was deprecated and that it needed to be from redux-saga/effects
.
Doing so seems to have broken rstp, and now I get the following error:
console.error node_modules/redux-saga/lib/internal/utils.js:240
uncaught at tokenSaga at tokenSaga
at takeEvery
TypeError: Cannot read property 'next' of undefinedat sagaWrapper ([...]redux-saga-test-plan/lib/expectSaga/sagaWrapper.js:54:34)
switching back to the root takeEvery import works without a problem. Also worth noting that the sagas work fine outside of the test scenario.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Redux-Saga: TypeError: Cannot read properties of undefined ...
I am not sure what's causing this error, but even the logger of my app doesn't even show the actions being dispatched. Any...
Read more >A brand new website interface for an even better experience!
Using takeEvery from redux-saga/effects causes TypeError: Cannot read property 'next' of undefined.
Read more >How to Avoid the Infamous "Cannot read properties of ... - Bitovi
With TypeScript, there are two ways of interpreting null and undefined ... avoid the 'Cannot read properties of undefined' runtime TypeError.
Read more >yelouafi/redux-saga - Gitter
Uncaught (in promise) TypeError: Cannot read property 'sagaStack' of undefined ... a single saga using redux-saga/effects/fork and redux-saga/effects/all .
Read more >API Reference - Redux-Saga
If take is called with no arguments or '*' all dispatched actions are matched (e.g. take() will match all ... import { takeEvery...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jfairbank Addition: if called function in effect ‘fork’ has one argument
await expectSaga(myExampleSaga) .provide({ fork: effect => effect.fn(effect.args[0]), }) .run();
if called function in effect ‘fork’ has two arguments
await expectSaga(myExampleSaga) .provide({ fork: effect => effect.fn(effect.args[0], effect.args[1]), }) .run();
etc
@jfairbank When I was testing sagas with effect “fork”, I have errors like:
And I guess that all this errors exist, because ‘redux-saga-test-plan’ calls function in effect ‘fork’ incorrectly. I solved this problem with
await expectSaga(myExampleSaga) .provide({ fork: effect => effect.fn(effect.args[0]), }) .run();