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

Unable to resolve module react-dom #2099

Closed
1 task done
talaikis opened this issue Dec 4, 2023 · 10 comments · Fixed by #2100
Closed
1 task done

Unable to resolve module react-dom #2099

talaikis opened this issue Dec 4, 2023 · 10 comments · Fixed by #2100

Comments

@talaikis
Copy link

talaikis commented Dec 4, 2023

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

  • React: 18.2.0
  • React Native: 0.72.6
  • Redux: 5.0.0
  • React Redux: 9.0.0

What is the current behavior?

Unable to resolve module react-dom

What is the expected behavior?

No react-dom in react-native

Which browser and OS are affected by this issue?

No response

Did this work in previous versions of React Redux?

  • Yes
@markerikson
Copy link
Contributor

This is probably a result of the ESM packaging updates. We used to have separate batchedUpdates.js and batchedUpdates.native.js files, and now that we pre-bundle those aren't there.

Looking into this, but I don't use RN myself - may need some help testing out fixes!

@markerikson
Copy link
Contributor

@talaikis can you provide a repo project that reproduces this issue?

@markerikson
Copy link
Contributor

I was able to repro the issue and the (hopeful) fix is live in 9.0.1.

Can you let us know if that works?

@TheWirv
Copy link

TheWirv commented Dec 8, 2023

Hi @markerikson, this issue occurs for me when testing (my React Native project) via jest. Since jest needs CJS, it ignores react-redux.react-native.js and rather uses crs/react-redux.development.cjs. Do you have any idea how to solve this?

@markerikson
Copy link
Contributor

@TheWirv : not immediately. Going to need some time to think through the possible ramifications here, unfortunately :(

@markerikson markerikson reopened this Dec 8, 2023
@TheWirv
Copy link

TheWirv commented Dec 8, 2023

No problem at all, I didn't really expect you to automagically come up with a solution. Thank you very much for reopening.

@markerikson
Copy link
Contributor

@TheWirv could you try out the CodeSandbox CSB build over in #2104 , both in your tests and in your app, and let me know how that works?

@TheWirv
Copy link

TheWirv commented Dec 8, 2023

That PR actually fixes my issues completely. The app works perfectly fine, and the tests are all green. 👌🏼

@markerikson
Copy link
Contributor

@TheWirv okay, that's very helpful feedback, thank you! I'll probably release that shortly.

@TheWirv
Copy link

TheWirv commented Dec 11, 2023

Good morning. I got confirmation that this problem has been solved by newly released v9.0.3. Thanks so much for the fix on such short notice. :)

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

Successfully merging a pull request may close this issue.

3 participants