Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Redux-thunk doesn't work in production (SSR) #75

Closed
darkadept opened this issue Nov 1, 2016 · 1 comment · Fixed by #76
Closed

Redux-thunk doesn't work in production (SSR) #75

darkadept opened this issue Nov 1, 2016 · 1 comment · Fixed by #76

Comments

@darkadept
Copy link
Contributor

It doesn't work to dispatch thunk actions in production SSR. The following error occurs:

Error: Actions must be plain objects. Use custom middleware for async actions..

From what I can tell it's because the makeStore.js is never called in production SSR (createSSR.js). The store is created with:
const store = createStore(makeReducer(), iMap())
Middlewares are not applied during SSR.

@jedwards1211
Copy link
Member

Good point, we could use makeStore on both server and client side and wrap application of client-specific middlewares in if (Meteor.isClient) blocks.

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

Successfully merging a pull request may close this issue.

2 participants