-
Notifications
You must be signed in to change notification settings - Fork 1k
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
When browser doesn't have the redux devtools extension the app throws an undefined error #320
Comments
That's because you're including it inside the compose. In this case you should use |
Hm ok I see. Does the I haven't tested this on a basic store, but if it does work on a basic store then maybe it could be nicer to only have a single line of code that will add the functionality for both? What do you think? |
Yes, it does. Because the enhancer is last in the compose, it is not aware of other middlewares and enhancers, thus remotely dispatched actions wouldn't work as expected and See the blog post for more details why we introduced this. |
|
To clarify, you should use one of them for the specific case, not both. |
Ok thank you. I got started with the basic store setup and didn't look at the advanced setup when I started including enhancers. Thanks for explaining things so clearly! |
You're welcome. We could add a note in the README for the basic store and information about that exception in troubleshooting. If you change your pr with that, it would be much appreciated. |
Ok will do |
Hello i tried the advnaced store example, but still the same when i use icognito window without redux devtools extension available, i get the
this is my code
|
I wonder why redux is not checking for |
I'm also getting the same issue. Can't find a fix. |
@Shadowman4205 that solution does not work for me too, instead I tryed with
and this works, also
but I am still confused Note:
works for me |
@Shadowman4205 I was having the same issue until I changed it slightly to match the Advanced Setup guide:
Here I'm passing an empty |
see solution through package here(worked for me): |
I needed to go from this: const composeEnhancers = !__PROD__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : compose To this: const composeEnhancers = !__PROD__ ? (window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose) : compose |
i fixed mine, now my app can now run with or without reduxDevtool installed i just changed
to
|
Bottom one worked for me thanks so much |
@KrishieldKyle: thx! |
@Arrow7000 thx |
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 onundefined
, thereby causing the error.I therefore propose to change this line in the documentation to:
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.
The text was updated successfully, but these errors were encountered: