-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
[TypeError] Object is not a constructor #1980
Comments
Maybe wrap a try {
//...
} catch (e) {
console.log(e.toString(), e.stack.toString());
throw e;
} around it. With the given information it's pretty impossible to say anything. |
@phryneas where should I put the try-catch? That's what confused me the most, since the error doesn't show where the root cause is, not on the Logbox, RN dev tools and Flipper. |
Around the place that you assume causes the error. If you say it happens when creating the store, wrap it around |
@phryneas I did this, and it didn't throw any errors: It's very hard to find the cause since the error does not specify where it comes from. Maybe it is something with redux-toolkit? |
This doesn't appear to be a bug with Redux or RTK. Like Lenz said, you can do that wrapping to track down the source of the error. The storybook one is probably a good place to start. Go into your node_modules folder and find this code (after transpilation) to add the more descriptive error handling there (particularly |
just in case anyone stumbles upon this: it was Storybook. I don't know why it breaks, but removing the Storybook imports solved the problem. Really weird. |
What version of React, ReactDOM/React Native, Redux, and React Redux are you using?
What is the current behavior?
Whenever I create my store on the App entry point, I get this error:
This error does not spawn a Logbox with errors, but it breaks some of my app's libraries. As an example, Apollo requests always return undefined, and
react-native-image-crop-picker
does not work correctly.This is my entry point stack:
![image](https://user-images.githubusercontent.com/37988252/210213275-be2ae039-f463-41b8-ba9b-20b0b74ba9f3.png)
I think its probably something to do with a library conflict or something, but it's making my head burn trying to solve it. I've tried everything: moving the provider location, adding it onto the index.js file, with no success.
This is my store configuration:
![image](https://user-images.githubusercontent.com/37988252/210213715-98ccc55b-7e86-4e84-b69b-14720465b69a.png)
This is one of my reducers:
![image](https://user-images.githubusercontent.com/37988252/210213774-23529116-98c9-401f-89eb-227c79786271.png)
What is the expected behavior?
Everything should work without breaking the app.
Which browser and OS are affected by this issue?
Android - API Level 33
Did this work in previous versions of React Redux?
The text was updated successfully, but these errors were encountered: