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.

Non-string action types are reported `<UNDEFINED>`

See original GitHub issue

You can use anything as an action type, but it seems like only strings are logged properly.

screen shot 2018-02-21 at 3 31 30 pm

For example if you have LOAD_USER = Symbol('load user'); and then dispatch({ type: LOAD_USER }), it will log the action as <UNDEFINED>.

The action type should be logged as String(action.type).

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
zalmoxisuscommented, Feb 21, 2018

Use serialize parameter for that:

const store = Redux.createStore(reducer, window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__({
  serialize: true
}));

See API docs for more details.

I actually was trying to do the way you suggested in redux-devtools-instrument, but that was causing issues when recomputing actions.

3reactions
iamscottcoxcommented, Aug 6, 2018

I’m having a similar issue, but some of my Symbol action types are being logged.

screenshot 2018-08-06 11 50 24

We have passed serialize as an option: screenshot 2018-08-06 11 53 59

Any ideas on what might cause this? 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Action.type undefined error in Redux Reducer - Stack Overflow
I noticed my mapDispatchToProps was written kinda strange so I fixed that, but I still get the error actions is undefined if I...
Read more >
createAction - Redux Toolkit
Non-String Action Types ​. In principle, Redux lets you use any kind of value as an action type. Instead of strings, you could...
Read more >
Found template literal expression having a non-string type
Found template literal expression having a non-string type JS-0378. Anti-pattern ... Invalid type "string | undefined" of template literal expression.
Read more >
String.prototype.toUpperCase() - JavaScript - MDN Web Docs
The toUpperCase() method returns the calling string value converted to uppercase (the value will be converted to a string if it isn't one)....
Read more >
Code Inspections in PHP | PhpStorm Documentation - JetBrains
Commonly, such loops are intended to perform an action only on their first ... Reports the parameters in function calls whose types are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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