From e9177005562e48d4ba2e622c3ae2faf00bba80a7 Mon Sep 17 00:00:00 2001 From: Alexander Danilowicz Date: Wed, 6 Jan 2021 23:03:57 -0800 Subject: [PATCH 1/2] Troubleshooting info about extension absence causing undefined error with compose usage --- docs/Troubleshooting.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/Troubleshooting.md b/docs/Troubleshooting.md index f7be9e5b..96fbd475 100644 --- a/docs/Troubleshooting.md +++ b/docs/Troubleshooting.md @@ -109,3 +109,20 @@ const store = Redux.createStore(reducer, window.__REDUX_DEVTOOLS_EXTENSION__ && ``` It will handle also date, regex, undefined, error objects, symbols, maps, sets and functions. + +### Without browser extension installed, app fails to load + +If your app fails to load without the browser extension installed, you are likely including your `window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()` in a `Redux.compose(...)`. + +`__REDUX_DEVTOOLS_EXTENSION__` should be used only when it's the only enhancer, not to be included in the compose. + +You should use `window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose` instead. Reference the [Advanced store setup](README.md#12-advanced-store-setup): + +``` +import { createStore, applyMiddleware, compose } from 'redux'; + +const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; +const store = createStore(reducer, /* preloadedState, */, composeEnhancers(...) +``` + +See #320 for discussion. From 29227f4471bc3e29f3e5872bbdbee053c7c40cf6 Mon Sep 17 00:00:00 2001 From: Alexander Danilowicz Date: Wed, 6 Jan 2021 23:07:58 -0800 Subject: [PATCH 2/2] Update issue link --- docs/Troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Troubleshooting.md b/docs/Troubleshooting.md index 96fbd475..e54d8089 100644 --- a/docs/Troubleshooting.md +++ b/docs/Troubleshooting.md @@ -125,4 +125,4 @@ const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose; const store = createStore(reducer, /* preloadedState, */, composeEnhancers(...) ``` -See #320 for discussion. +See https://github.com/zalmoxisus/redux-devtools-extension/issues/320 for discussion.