Actions must be plain objects React Origin: On your device OSI layer 7 · Application Last updated 14 Oct 2026

Error: Actions must be plain objects. Instead, the actual type was: 'function'.

A function (thunk) was dispatched but the thunk middleware isn’t configured.

Exact message you may see Actions must be plain objectsthe actual type was: 'function'
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

  1. Use Redux Toolkit configureStore (thunk included)
  2. When customizing middleware use getDefaultMiddleware().concat(...)
  3. Dispatch action objects: dispatch(addTodo(text))

Detailed fix by platform

React

  1. configureStore({ reducer, middleware: getDefault => getDefault().concat(logger) })

How to diagnose

  1. Middleware — Is thunk included?
  2. Dispatch — What value is dispatched?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

409 — HTTP 409 Conflict (HTTP)409Error acquiring the state lock — Terraform: Error: Error acquiring the state lock — ConditionalCheckFailedException / state blob is already locked (Terraform)Error acquiring the s…IllegalStateException — java.lang.IllegalStateException (Java)IllegalStateExceptionMaximum update depth — Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. (React)Maximum update depthModifying state during view update — SwiftUI: Modifying state during view update, this will cause undefined behavior (iOS)Modifying state durin…non-serializable value — A non-serializable value was detected in the state / in an action, in the path (React)non-serializable valueOptimisticLockException — Optimistic lock conflict: OptimisticLockException / StaleObjectStateException / version mismatch (API)OptimisticLockExcepti…read-only property — TypeError: Cannot assign to read only property 'x' of object (JavaScript)read-only propertyActions m…

Explore the map of this error Full error map →

🧠 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.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.