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

All shared dependencies are being fetched multiple times, not working as single instance .. #446

Open
AsuraKev opened this issue Jun 29, 2023 · 5 comments

Comments

@AsuraKev
Copy link

Hi All,

I am getting React error as below when I have already listed react, react-dom, react-router as shared in both host and remote
Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: 1. You might have mismatching versions of React and the renderer (such as React DOM) 2. You might be breaking the Rules of Hooks 3. You might have more than one copy of React in the same app See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.

image

@christophediprima
Copy link

christophediprima commented Jul 4, 2023

Having the same issue! Do you have the same use case as this one: #449 ? Do you have modules being both host and remote?

@AsuraKev
Copy link
Author

For more information I have the following setup

Remote vite config

image

Remote exposed register function
image

In host I just called the register function to mount the remote app. This is different from the example where instead of just importing the remote component, instead I invoke a method to load the remote application

image

@AsuraKev
Copy link
Author

Downgraded to version 1.1.14 and its working. Latest version seems to be broken

@coolcorexix
Copy link

Downgraded to version 1.1.14 and its working. Latest version seems to be broken

we have a different problem back in 1.1.14, it's the shared does not have checksum at the end which cause the caching error - a big reason why I had to upgrade to 1.3.*

@AsuraKev
Copy link
Author

AsuraKev commented Feb 2, 2024

I am switching to rspack soon. A lot of native module federation support going to happen there! This package looks like it’s being abandoned

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

3 participants