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.

I cannot debugger or console.log inside an action. It does nothing and also swallows all errors.

How can I see what is going on inside an action?

export const {
  reducer: platformReducer,
  actions: platformActions
} = autodux({
  slice: 'platforms',
  initial: {},
  actions: {
    setPlatforms: (_, payload) => {
      const newPlatform = {};
      console.log(payload);
      debugger;
      payload.forEach(g => newPlatforms[g.id] = g);
      return newPlatforms;
    }
  }
});

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ericelliottcommented, May 10, 2019

I did notice that you’re mutating an object that does not exist in your reducer.

At the top of the reducer, you have:

const newPlatform = {};

Then, when you try to use it, you use newPlatforms instead of newPlatform.

Any good lint tool should point out this kind of mistake for you. I wrote an article on setting up lint tools.

Screen Shot 2019-05-10 at 9 37 11 AM
0reactions
ericelliottcommented, May 10, 2019

Another thing to try: Can you reproduce it when you try to reduce over an array of actions with Array.prototype.reduce?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enabling debug logging - GitHub Docs
To enable step debug logging, you must set the following secret in the repository that contains the workflow: ACTIONS_STEP_DEBUG to true . ·...
Read more >
GitHub Actions: Re-run jobs with debug logging
You can now enable debug logging when you re-run jobs in a GitHub Actions workflow run. This gives you additional information about the ......
Read more >
Debugging Actions - UiPath Documentation Portal
Debugging of a single file or the whole project can be performed both from the Design or Debug ribbon tabs. However, the debugging...
Read more >
Debugging in Visual Studio Code
One of the great things in Visual Studio Code is debugging support. Set breakpoints, step-in, inspect variables and more.
Read more >
debug-action - IBM
Use the debug-action command to begin a debug session of a GatewayScript action in a processing policy. Use the no debug-action command to...
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