Skip to content
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

Connect can still swallow errors #1974

Closed
1 task
Nantris opened this issue Nov 20, 2022 · 3 comments
Closed
1 task

Connect can still swallow errors #1974

Nantris opened this issue Nov 20, 2022 · 3 comments

Comments

@Nantris
Copy link

Nantris commented Nov 20, 2022

What version of React, ReactDOM/React Native, Redux, and React Redux are you using?

  • React: 18.1.0
  • ReactDOM/React Native: N/A
  • Redux: 4.2.0
  • React Redux: 8.0.4

What is the current behavior?

Errors are swallowed inside of mapStateToProps sometimes. I'm not sure of the exact circumstances to recreate this.

What is the expected behavior?

Errors are never swallowed

Which browser and OS are affected by this issue?

Electron 18

Did this work in previous versions of React Redux?

  • Yes
@Nantris
Copy link
Author

Nantris commented Nov 20, 2022

Quoting my original comment on another issue:

@markerikson is this believed to be fixed at this point? It seems not to be, or at least - I have no other theory for why our errors are getting swallowed inside of our mapStateToProps.

I've spent an hour trying to pinpoint the exact cause for us, and this issue is my only lead.

Specifically, this component uses forwardRef - so I wonder if that could be related? Version 8.0.4. I discovered this when I accidentally typed 'some text'.contains('') instead of 'some text'.includes('') and everything broke, but no error appears.

If I call the function from anywhere else, or manually from console - the errors appear as expected.

The only other thing that's really even remotely of interest that I can see is that the function that's called is memoized.

I've seen errors properly logged from mapStateToProps plenty of times - but it just won't work here. Coincidentally, this is one of only four components we have with forwardRef: true.

@Nantris
Copy link
Author

Nantris commented Nov 20, 2022

I was able to test with forwardRef: false and excluding the 3rd/4th arguments for connect but the issue persists.

@markerikson
Copy link
Contributor

I did ask for this new issue to be filed, and I appreciate that you did that.

But honestly, we have no real plans (or time!) to make further changes to connect at this point.

If anyone ever wants to take a stab at this, or can provide a Replay ( https://replay.io/record-bugs ), I can take a quick look. But until then, I'm going to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants