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.

Freezes on empty action payload

See original GitHub issue

Hi,

This one is weird. When using an action creator with an empty payload created using redux-actions, the application badly fails and freezes.

import { createAction } from 'redux-actions';
// dispatching this will freeze the app
const myEmtpyPayloadAction = createAction('HI');

No payload field is still FSA-compliant, so this should’n’t happen. I can’t tell where this freeze however.

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
biggyspendercommented, Jan 18, 2019

This happens when the serializer chokes on bad input. Most likely you’ve attached a DOM event to your action. When these hit the IPC serializer, (I suspect because of the cycles in the object-graph of events), the serializer hangs.

For instance, if you

<button onClick={dispatchSomeAction}>do something?</button>
//calls dispatchSomeAction(clickEvent)... now our payload is a DOM event

instead of

<button onClick={() => dispatchSomeAction()}>do something?</button>
//definitely no payload

you’ll blow up the serialization process.

0reactions
hardchorcommented, Apr 29, 2020

Thanks for the input! Feel free to reopen if @biggyspender’s hint didn’t work for you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Freezes on empty action payload #57 - klarna/electron-redux
Hi,. This one is weird. When using an action creator with an empty payload created using redux-actions , the application badly fails and...
Read more >
State is Empty but the Action is loading the data - Stack Overflow
State is Empty but the Action is loading the data ; import { FETCH_DATAS } ; export default ; switch(action.type) ; return action.payload...
Read more >
Redux actions - Fullstack React
Recall that the only way we can change data in Redux is through an action creator. ... we'll pass extra data along as...
Read more >
Writing Reducers with Immer | Redux Toolkit - JS.ORG
Not only are there no more spread operations that can be mis-written, but Immer freezes state automatically as well.
Read more >
Actions and reducers: updating state - Human Redux
In Redux all changes to the application state happen via an "action. ... I always put these types of values in a property...
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