question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When browser doesn't have the redux devtools extension the app throws an undefined error

See original GitHub issue

My 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:open
  • Created 7 years ago
  • Reactions:34
  • Comments:19 (5 by maintainers)

github_iconTop GitHub Comments

71reactions
zalmoxisuscommented, Mar 10, 2017

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.

25reactions
KrishieldKylecommented, Dec 17, 2018

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found