How I Fixed: uncaught at check call: argument [object Promise] is not a function

Earlier this month I started dabbling with Redux Sagas as an alternative to Redux Thunks.

At the time I was highly skeptical – largely around whether re-writing a significant portion of my JavaScript was good use of my time, given that I had no prior experience with generators, and that conceptually sagas sounded pretty hard.

But I kept hitting issues with Thunks. They just seemed so cumbersome, and error prone. I found writing tests for them to be painful, and adding in the Redux API Middleware made that even more complicated.

Ultimately, switching to Redux Saga has been one of the highlights of my current project. I love it. Every problem I have had so far has been made easier through the use of sagas.

But today I hit on a problem I haven’t seen before:

This is a generic version of the code I am using:

I have highlighted the problematic line.

The issue here is that the error in the browser is fairly cryptic. It took me digging into the source code to figure this one out.

But actually the issue is really simple to fix.

The highlighted line above should be :

I was calling my function myself, and then passing the promise on to the Saga… whoopsie daisy.




Published by

Code Review

Code Review

CodeReviewVideos is a video training site helping software developers learn Symfony faster and easier.

38 thoughts on “How I Fixed: uncaught at check call: argument [object Promise] is not a function”

  1. Thanks. You saved me some time as well !
    Additional tip: if you need to pass more than one parameter to the function, consider passing an array of arguments… πŸ˜‰

  2. Came here to say thank you. I was still partially in thunk-mode and didn’t realize the call effect takes the function and then variables as parameters.

  3. Wow, thanks. I was looking at that problem, totally lost and not looking forwards to doing the digging myself. Put in the error and your article popped up. Thanks!

  4. Just to let you know that you save my life LoL…I also just started with saga and seeing this “fix” I remembered right way of the docs and I see how dumb I was being hahahaa


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.