Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: when extension is not present and app fails to load due to compose usage #773

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions docs/Troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 https://github.com/zalmoxisus/redux-devtools-extension/issues/320 for discussion.