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.

Error with redux-saga middleware

See original GitHub issue

Noob here getting an error which seems to indicate that the saga middleware is not getting loaded properly with the store.

F:\Courses\react-native-redux\manager\node_modules\react-native\Libraries\Core\ExceptionsManager.js:71uncaught at check Before running a Saga, you must mount the Saga middleware on the Store using applyMiddleware

Here is my store setup:

/* eslint-disable no-underscore-dangle */
    const sagaMiddleware = createSagaMiddleware();
    const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION__ || compose;
    const store = createStore(
        reducers,
        initialState,
        composeEnhancers(applyMiddleware(sagaMiddleware)),
      );
    sagaMiddleware.run(sagas);
/* eslint-enable */

Issue Analytics

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

github_iconTop GitHub Comments

25reactions
jhen0409commented, Nov 15, 2016
/* eslint-disable no-underscore-dangle */
    const sagaMiddleware = createSagaMiddleware();
    const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION__ || compose;
    const store = createStore(
        reducers,
        initialState,
        composeEnhancers(applyMiddleware(sagaMiddleware)),
      );
    sagaMiddleware.run(sagas);
/* eslint-enable */

If you want to take compose function, should use __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ instead of __REDUX_DEVTOOLS_EXTENSION__ enhancer.

Let me know if it work for you. 😃

0reactions
jhen0409commented, Nov 16, 2016

It DOES happen at http://localhost: 8081/debugger-ui.

Ok, because this project is based on official debugger, it’s may still a long-term problem. 🤔 (https://github.com/facebook/react-native/issues/5632)

I’m closing this issue because the title problem is resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Handling | Redux-Saga
We want to handle those errors inside our Saga by dispatching a PRODUCTS_REQUEST_FAILED action to the Store. We can catch errors inside the...
Read more >
Redux Saga Error Handling. Problem - Yini Yin - Medium
So we have to options here: 1. Add an onError function to the middleware option. 2. Chain a catch function at returned promise...
Read more >
Error Handling Pattern with React and Redux-Saga - Outcrawl
Here's a pattern I've been using to deal with failure states on request/response type actions when using Redux with Redux-Saga.
Read more >
Redux Saga Error Handling | Welcome to Yini's blog
Add an onError function to the middleware option. Chain a catch function at returned promise of sagaMiddleware.run(). import { createStore ...
Read more >
how can I setup a global error handler? #1672 - GitHub
const rootTask = sagaMiddleware.run(rootSaga); rootTask.done.catch(function (err) { console.log("Error in Sagas", err); });.
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