{"record":{"id":"e986b442b8882ca3","repo":"reduxjs/redux","slug":"it-looks-like-you-are-passing-several-store-enhanc","errorCode":null,"errorMessage":"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.","messagePattern":"It looks like you are passing several store enhancers to createStore\\(\\)\\. This is not supported\\. Instead, compose them together to a single function\\. See https://redux\\.js\\.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/createStore.ts","lineNumber":109,"sourceCode":"  PreloadedState = S\n>(\n  reducer: Reducer<S, A, PreloadedState>,\n  preloadedState?: PreloadedState | StoreEnhancer<Ext, StateExt> | undefined,\n  enhancer?: StoreEnhancer<Ext, StateExt>\n): Store<S, A, UnknownIfNonSpecific<StateExt>> & NoInfer<Ext> {\n  if (typeof reducer !== 'function') {\n    throw new Error(\n      `Expected the root reducer to be a function. Instead, received: '${kindOf(\n        reducer\n      )}'`\n    )\n  }\n\n  if (\n    (typeof preloadedState === 'function' && typeof enhancer === 'function') ||\n    (typeof enhancer === 'function' && typeof arguments[3] === 'function')\n  ) {\n    throw new Error(\n      'It looks like you are passing several store enhancers to ' +\n        'createStore(). This is not supported. Instead, compose them ' +\n        'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.'\n    )\n  }\n\n  if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {\n    enhancer = preloadedState as StoreEnhancer<Ext, StateExt>\n    preloadedState = undefined\n  }\n\n  if (typeof enhancer !== 'undefined') {\n    if (typeof enhancer !== 'function') {\n      throw new Error(\n        `Expected the enhancer to be a function. Instead, received: '${kindOf(\n          enhancer\n        )}'`\n      )","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/reduxjs/redux/blob/3084fc33bb23ab4cab4796172eafe342da4e73d9/src/createStore.ts#L91-L127","documentation":"createStore accepts at most one enhancer. Redux detects when a caller passes two enhancers (either as the second and third positional args, or third and fourth) — this pattern means the enhancers were not composed, so only one would take effect and the other silently dropped. The error points to compose() as the supported way to combine enhancers.","triggerScenarios":"createStore(reducer, preloadedState, applyMiddleware(...), devToolsEnhancer()) — two enhancers in positions 3 and 4; createStore(reducer, enhancerA, enhancerB) where the preloadedState slot was skipped and both enhancers land in slots 2 and 3; calling createStore with a variable-arg spread of enhancers.","commonSituations":"Adding redux-devtools enhancer alongside applyMiddleware without composing them; tutorial code that passes each enhancer separately; refactor that moved preloadedState into a different call site leaving two enhancers adjacent.","solutions":["Compose the enhancers into one: `createStore(reducer, preloadedState, compose(applyMiddleware(...), devToolsEnhancer()))`.","With redux-devtools-extension use the preloadedState-aware form: `composeEnhancers(applyMiddleware(...))` as the single third argument.","Confirm you are not accidentally spreading an array of enhancers as separate positional args."],"exampleFix":"// before\nconst store = createStore(\n  rootReducer,\n  preloadedState,\n  applyMiddleware(thunk),\n  window.__REDUX_DEVTOOLS_EXTENSION__?.()\n)\n\n// after\nimport { compose, createStore, applyMiddleware } from 'redux'\nconst composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose\nconst store = createStore(\n  rootReducer,\n  preloadedState,\n  composeEnhancers(applyMiddleware(thunk))\n)","handlingStrategy":"validation","validationCode":"// Enforce a single composed enhancer before createStore:\nconst ensureSingleEnhancer = (...enhancers) => {\n  const fns = enhancers.filter(e => typeof e === 'function')\n  if (fns.length > 1) {\n    throw new Error('Pass a single composed enhancer via compose(...).')\n  }\n  return fns[0]\n}","typeGuard":"const isEnhancer = (x): x is Function => typeof x === 'function'","tryCatchPattern":null,"preventionTips":["Always compose multiple enhancers into one with compose().","Build devtools-aware compose via `window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose`.","Pass enhancers as the single third argument to createStore."],"tags":["redux","createstore","enhancer","compose","multiple-arguments"],"backgroundTag":null,"analyzedSha":"3084fc33bb23ab4cab4796172eafe342da4e73d9","analyzedAt":"2026-08-12T13:21:41.727Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}