Skip to content

fix: use __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ to avoid Redux error #0 - #140

Open
jexp wants to merge 1 commit into
mainfrom
fix/redux-devtools-compose
Open

fix: use __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ to avoid Redux error #0#140
jexp wants to merge 1 commit into
mainfrom
fix/redux-devtools-compose

Conversation

@jexp

@jexp jexp commented May 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the old __REDUX_DEVTOOLS_EXTENSION__ pattern in createStore with the correct __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ approach
  • The old pattern broke when the Redux DevTools browser extension was installed, causing a blank screen with "Minified Redux error #0"
  • Falls back to Redux's own compose when the extension is not present, so behavior is unchanged for users without DevTools installed

Root cause

The old code passed two separate enhancers to createStore:

createStore(reducer, devtoolsEnhancer, applyMiddleware(...))

This is only safe in certain Redux 4.x code paths and breaks with the DevTools extension's newer API. The correct pattern composes them into one:

const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
createStore(reducer, composeEnhancers(applyMiddleware(...)))

Fixes #133

The old pattern passed the DevTools enhancer as preloadedState and the
middleware enhancer as the third arg, which breaks when the Redux DevTools
browser extension is installed (causes "Minified Redux error #0" blank screen).

The correct pattern uses __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ (falling back
to Redux's own compose) so both enhancers are composed safely as a single
store enhancer.

Fixes #133
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Website currently crashes with redux errors

1 participant