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

How can I connect an application with a newer version of react? #220

Open
ohmygodismax opened this issue Dec 11, 2024 · 5 comments
Open

Comments

@ohmygodismax
Copy link

ohmygodismax commented Dec 11, 2024

When the module is dynamically connected via @module-federation/enhanced/runtime,, at the moment, when I try to use 2 different instances of the react library (an older version on the host application), I get an error:
image

But the module federation instance shows that 2 react instances have been loaded:
image

The problem is solved when using singleton, but this is not the behavior I expect.

@gioboa
Copy link
Collaborator

gioboa commented Dec 11, 2024

The problem is solved when using singleton, but this is not the behavior I expect.

Hi @ohmygodismax
What's your expectation? Can you create a basic repo for this?

@ohmygodismax
Copy link
Author

Hi @gioboa
Yes, something like this https://github.com/ohmygodismax/mf-vite-example

@gioboa
Copy link
Collaborator

gioboa commented Dec 20, 2024

@ohmygodismax I didn't have the time to look at it. Did you find a solution for that?

@ohmygodismax
Copy link
Author

@gioboa I was unable to use 2 versions of react with an older one in the host application. So far, I've settled on the option where the connection is via a singletone with a warning that the host application has an older version.

@gioboa
Copy link
Collaborator

gioboa commented Dec 23, 2024

I see, is your scenario working with webpack / rspack?

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