question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When I run this simple code

function* fetchUser() {
  yield 1;
}

function* watchLastFetchUser() {
  yield* takeLatest('USER_REQUESTED', fetchUser);
}

export default function* root() {
  yield [
    fork(watchLastFetchUser)
  ];
}

I get

redux-saga error: uncaught
at root 
 at watchLastFetchUser 
 TypeError: Cannot read property 'done' of undefined

I’m using saga’s done() method for server rendering. Simple sagas, that yield simple effects work fine. Simple implementation of takeLatest (like in docs) also works.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:18 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
yelouaficommented, Aug 10, 2016

I think we can get around this by implementing return in iterators returned by saga helpers. Already pushed a fix with this solution. I did the tests locally on the @smashercosmo fork and the error is gone (although there are still an error related to import statements but that’s related to missing node presets)

3reactions
aaronjensencommented, Aug 23, 2016

erg, this is a nasty one. A release would be great, especially since we can’t just depend on the github version w/o building the release ourselves.

Read more comments on GitHub >

github_iconTop Results From Across the Web

takeLatest in effect not working · Issue #769 · redux-saga ...
I dipatch the action from componentDidMount. The takeLatest function is triggering as many requests as I mount the component, and is not ...
Read more >
API Reference - Redux-Saga
And if this action matches pattern , takeLatest starts a new saga task in ... You can check inside the finally block if...
Read more >
Redux Saga Error: takeLatest$1 requires a pattern or channel
Well, for me my action type was undefined, I changed the original file where I defined the types and forgot to effect the...
Read more >
6 Handling complex side effects - Redux in Action
Your application may need to verify login credentials, issue an authorization token, ... import { call, put, takeLatest } from 'redux-saga/effects'; ...
Read more >
How to use the redux-saga.takeEvery function in redux-saga
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found