Skip to content

Getting Error Actions must be plain objects. Use custom middleware for async actions. #413

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

Closed
nikiben opened this issue Jan 25, 2018 · 5 comments

Comments

@nikiben
Copy link

nikiben commented Jan 25, 2018

Help Getting this error below.. please see Stack Overflow for more details..
https://stackoverflow.com/questions/48388594/angular-redux-epics

core.js:1427 ERROR Error: Actions must be plain objects. Use custom middleware for async actions.
    at Object.performAction (<anonymous>:3:2312)
    at liftAction (<anonymous>:2:27846)
    at dispatch (<anonymous>:2:31884)
    at eval (createEpicMiddleware.js:67)
    at SafeSubscriber.dispatch [as _next] (applyMiddleware.js:35)
    at SafeSubscriber.__tryOrUnsub (Subscriber.js:240)
    at SafeSubscriber.next (Subscriber.js:187)
    at Subscriber._next (Subscriber.js:128)
    at Subscriber.next (Subscriber.js:92)
    at SwitchMapSubscriber.notifyNext (switchMap.js:127)
@jayphelps
Copy link
Member

Answered! I added the redux-observable tag to it too, which is the only tag I subscribe to. 😄

@ghasemikasra39
Copy link

I am getting the same error . Any. solution?

@jayphelps
Copy link
Member

@ghasemikasra39 That may or may not be related to your epics, but regardless it is likely truthful--you are dispatching something that is not a plain object. In this person's case they were simply missing a return statement, so undefined was what is being dispatched. But your case may well vary.

Your best bet is to pause your debugger when this happens, walk the stack back until you can see what in fact is being dispatched and from where. If you need help, your best bet is to create a small, simple reproducible piece of code you can share on Stack Overflow--you might even discover the cause in the process of doing so.

@ghasemikasra39
Copy link

Dear @jayphelps
When I pass in an async function to the mergeMap, and fetch my token out of my AsyncStorage, I get this error. But when I pass in a normal function, Everything works(I use static token though). I don't think it has something to do with my action.

@evertbouw
Copy link
Member

@ghasemikasra39 Please don't post new questions in old, closed issues. Your question will be hard to notice and it's unlikely to be related.

Can you ask the question on stack overflow, our gitter channel or the rxjs channel in the reactiflux discord? Until we can enable github discussions for this repo it's also fine to create a new issue. Please include the code that is giving you this error.

@redux-observable redux-observable locked as resolved and limited conversation to collaborators Jun 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants