Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

utils.js:240 uncaught at check runSaga(storeInterface, saga, ...args): saga argument must be a Generator function! log @ utils.js:240 check @ utils.js:44 runSaga @ runSaga.js:31 2../Counter @ main.js:18 o @ _prelude.js:1 r @ _prelude.js:1 (anonymous) @ _prelude.js:1 utils.js:45 Uncaught Error: runSaga(storeInterface, saga, ...args): saga argument must be a Generator function! at check (utils.js:45) at runSaga (runSaga.js:31) at Object.2../Counter (main.js:18) at o (_prelude.js:1) at r (_prelude.js:1) at _prelude.js:1 check @ utils.js:45 runSaga @ runSaga.js:31 2../Counter @ main.js:18 o @ _prelude.js:1 r @ _prelude.js:1 (anonymous) @ _prelude.js:1 #57

Open
sareek opened this issue Mar 27, 2019 · 4 comments

Comments

@sareek
Copy link

sareek commented Mar 27, 2019

Error while trying to run 2 sagas at a time

@sareek sareek changed the title utils.js:240 uncaught at check runSaga(storeInterface, saga, ...args): saga argument must be a Generator function! log @ utils.js:240 check @ utils.js:44 runSaga @ runSaga.js:31 2../Counter @ main.js:18 o @ _prelude.js:1 r @ _prelude.js:1 (anonymous) @ _prelude.js:1 utils.js:45 Uncaught Error: runSaga(storeInterface, saga, ...args): saga argument must be a Generator function! at check (utils.js:45) at runSaga (runSaga.js:31) at Object.2../Counter (main.js:18) at o (_prelude.js:1) at r (_prelude.js:1) at _prelude.js:1 check @ utils.js:45 runSaga @ runSaga.js:31 2../Counter @ main.js:18 o @ _prelude.js:1 r @ _prelude.js:1 (anonymous) @ _prelude.js:1 utils.js:240 uncaught at check runSaga(storeInterface, saga, ...args): saga argument must be a Generator function! log @ utils.js:240 check @ utils.js:44 runSaga @ runSaga.js:31 2../Counter @ main.js:18 o @ _prelude.js:1 r @ _prelude.js:1 (anonymous) @ _prelude.js:1 utils.js:45 Uncaught Error: runSaga(storeInterface, saga, ...args): saga argument must be a Generator function! at check (utils.js:45) at runSaga (runSaga.js:31) at Object.2../Counter (main.js:18) at o (_prelude.js:1) at r (_prelude.js:1) at _prelude.js:1 check @ utils.js:45 runSaga @ runSaga.js:31 2../Counter @ main.js:18 o @ _prelude.js:1 r @ _prelude.js:1 (anonymous) @ _prelude.js:1 Mar 27, 2019
@sareek
Copy link
Author

sareek commented Mar 27, 2019

SOLVED!

The issue was with default keyword on the documentation in saga. While starting more than one Sagas at a time in documentation it is written as,

export default function* rootSaga() {......

It should be,

export function* rootSaga() {

@srbala
Copy link

srbala commented Jun 19, 2019

@sareek Please update edit subject/title line of this issue to more meaningful text

@srbala
Copy link

srbala commented Jun 27, 2019

@sareek since you have solved the problem, Please close this issue. if you can fix the title that would be great.

@pabloabreu1986
Copy link

SOLUTION!
*As you export function as default in sagas.js as follows;

export default function* rootSaga() {
  yield all([
    helloSaga(),
    watchIncrementAsync()
  ])
}

*You should change the import statement in main.js from:
import { rootSaga } from './sagas';
to:
import rootSaga from './sagas';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants