'.code' is undefined
See original GitHub issueSo, from time to time something breaks and my web app crashes cause of ".code'
is undefined exception.
I noticed that redux at this point is not even launching the "@@localize/INITIALIZE"
but still adds languages and launches the "@@localize/ADD_TRANSLATION_FOR_LANGUAGE"
I tried to put the locale into localstorage to maybe perhaps avoid the undefined '.code'
which occurs at "es/locale.js"
=> var activeLanguageCode = activeLanguage.code;
and read the stored locale with store.subscribe but it did not helped at all, '.code'
error is still happening.
I just followed the documentation, so I’m not sure what is going on This is how I’m dispatching it
store.dispatch(initialize([
{ name: 'English', code: 'en-US' },
{ name: 'German', code: 'de-DE' }
]))
store.dispatch(addTranslationForLanguage(settings.en_US, 'en-US'))
store.dispatch(addTranslationForLanguage(settings.de_DE, 'de-DE'))
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Why is a 'undefined' in this code? - Stack Overflow
First you need to understand that variables declared with let have block scope. And you can not declare same variable again within same...
Read more >undefined - JavaScript - MDN Web Docs - Mozilla
undefined is a property of the global object. That is, it is a variable in global scope. In all non-legacy browsers, undefined is...
Read more >What does 'undefined' mean in programming terminology?
It means anything can happen. The compiler developer is free to do whatever he wants when a language standard does not specify what...
Read more >What Is an Undefined Value? - Wise Geek
An undefined value typically occurs when there is an error in the code of a computer software program. Usually the variable that the...
Read more >How to Check for Undefined in JavaScript | Coding at Dawn
In JavaScript programming, you will encounter the primitive data type undefined, which indicates the absence of a value.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top 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
Just to add to what @DarkSmile92 posted in case it helps someone else…
The
dispatch
prop can be called directly by store, but more often than not you will be callingdispatch
from one of your components. It’s important to remember that as soon as youconnect
a componentdispatch
is added to it’s props directly. If you’re already using connect though you will more than likely want to add your action creators usingmapDispatchToProps
like so:@pardonmeme since I haven’t heard back from you I’m going to assume this issue is settled. If you find you’re still having issues feel free to comment.
@ryandrewjohnson yes I solved mine. Hope this helps @pardonmeme with his.