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.

Sagas aren't being triggered, EFFECT_TRIGGERED only at startup

See original GitHub issue

I had sagas set up in my app, handling side effects. I hooked up the saga middleware to my store, passing in the rootSaga, and was successfully executing a side effect in response to an action. I committed this code, then proceeded to add another side effect to respond to a different action. This worked as well, and I committed it.

Now when I run my code, at startup I see EFFECT_TRIGGERED twice followed by EFFECT_RESOLVED twice, but other than that, the sagas are never triggered in response to the actions they’re set up to watch. I thought that was bizarre, so I reverted to a previous commit where I know the sagas’ side effects were working, and it too has this odd behavior. I then reverted to the first commit where I set up sagas, and it too isn’t working.

Do you have an idea what could cause such behavior? I’ve compared my sagas and store to those in the examples, and they look fine. Since my saga and store code were working fine before, but stopped working (without me changing them, or any underlying libraries), I’m thinking the issue has to be caused by something related to my development environment. I tried setting up the development environment of the app on a different computer, reinstalling node_modules from scratch, and it’s having the same issue. If you have any idea what could be causing this issue, I’d greatly appreciate it.

I’m using redux-saga 0.9.1

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:20 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
manjeetwadicommented, Dec 27, 2017

@tsemerad what solution had you adopted

0reactions
samar768commented, Oct 7, 2022

Hi, @neurosnap , thanks for your response, I am dispatching the action from the component. below is the code

// import statements import React, { useEffect } from “react”; import { connect } from “react-redux”; import { Card, CardBodyHeader } from “…/…/…/…/…/…/Common/components/General”; import { getUser } from “…/…/…/saga/sagaActions”;

// control for managing risk selection const AddressBICovers = (props) => { props.fn_getUser(); useEffect(() => {}, []); return ( <React.Fragment> <div className="main-content" id="divRiskSelection"> <section className="section"> <div className="row"> <Card cardSizes={[“col-12”]} cardColor=“card-primary” cardId=“riskSelectionCard” cardShowHide={true} cardHeaderText=“Bussiness Interruption Covers” animateCard={true} hasRateButton={true} handleOnRateClick={props.rateRiskSasria} showCardFooter={props.isLoading === true ? false : false} cardFooterTextArray={props.isLoading === true ? [] : []} // showWarningCardFooter={cardWarningFooterTextArray.length > 0} // cardWarningFooterTextArray={cardWarningFooterTextArray} > <div className="form-group"> <div className="row"></div> </div> </Card> </div> </section> </div> </React.Fragment> ); };

// map dispatch to props const mapDispatchToProps = (dispatch) => { return { fn_getUser: () => { return dispatch(getUser); }, }; };

// map state to props const mapStateToProps = (state) => { return { addressActiveOIKey: state.sidebarData.activeaddressOI, }; }; // component prop type validation AddressBICovers.propTypes = {};

// export redux connected component export default connect(mapStateToProps, mapDispatchToProps)(AddressBICovers);

Read more comments on GitHub >

github_iconTop Results From Across the Web

Saga not running when action creator being called inside ...
I try to call the action creator in componentDidMount, the action occurs (I can see it in dev tools) but the saga isnt...
Read more >
Troubleshooting | Redux-Saga
Make sure the Saga is not blocked on some effect. When a Saga is waiting for an Effect to resolve, it will not...
Read more >
Asynchronous with Redux Sagas - Medium
Hopefully this will prove to be a useful resource for you. Setup. Common Redux Saga methods (called Effects):. fork → Performs a non-blocking ......
Read more >
Saga - Apache Camel
Differently from transactions, Sagas are also not required to be completed ... invoked by Camel only when needed (if the saga is cancelled...
Read more >
Read Me | redux-saga
A composable abstraction Effect: waiting for an action, triggering state updates ... Getting started; Waiting for future actions; Dispatching actions to the ...
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