Error: Actions must be plain objects. Instead, the actual type was: 'function'.
A function (thunk) was dispatched but the thunk middleware isn’t configured.
Seen on:
React
Meaning
Plain Redux only accepts object actions. Redux Toolkit’s configureStore includes thunk by default; hand-made createStore setups need applyMiddleware(thunk).
Common causes
- Thunk middleware missing
- Custom middleware replacing defaults in configureStore
- Dispatching an action creator without calling it
⚡ Quick fix
- Use Redux Toolkit configureStore (thunk included)
- When customizing middleware use getDefaultMiddleware().concat(...)
- Dispatch action objects: dispatch(addTodo(text))
Detailed fix by platform
React
configureStore({ reducer, middleware: getDefault => getDefault().concat(logger) })
How to diagnose
- Middleware — Is thunk included?
- Dispatch — What value is dispatched?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026