When browser doesn't have the redux devtools extension the app throws an undefined error
See original GitHub issueMy React/Redux app worked fine on my computer but when I sent it to someone else the app would fail to load altogether.
After some debugging it turns out that window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
was returning undefined, which meant that .apply()
was being called on undefined
, thereby causing the error.
I therefore propose to change this line in the documentation to:
window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f
This will make sure that if the redux extension is not present, the store enhancer added will at least be a function, as opposed to undefined
.
I will submit a pull request immediately.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:34
- Comments:19 (5 by maintainers)
Top Results From Across the Web
Error with Redux DevTools Extension using TS: "Property ...
This worked for me! The problem is that when you use create-react-app inside the "client" folder, there is an added level in between...
Read more >zalmoxisus/redux-devtools-extension - Gitter
Hi, the plugin doesn't work in an angular 2 stable app. ... to be triggering an @@INIT action and then throwing an undefined...
Read more >redux-devtools-extension - npm
Start using redux-devtools-extension in your project by running `npm i ... TypeScript icon, indicating that this package has built-in type ...
Read more >cannot read property 'usememo' of null - You.com | The search ...
reducer' import {composeWithDevTools} from 'redux-devtools-extension' import ... React useRef hook causing "Cannot read property '0' of undefined" error.
Read more >Debugging Preact Apps
These include integration with our own Preact Devtools Extension for ... Preact will throw this error whenever you pass undefined instead of a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That’s because you’re including it inside the compose. In this case you should use
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose
instead. See Advanced store setup.i fixed mine, now my app can now run with or without reduxDevtool installed
i just changed
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
to
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__() || compose