Would it possible to use a NextJS remote in a Create React App (CRA) host app?
- On the NextJS Remote, I am using
@module-federation/nextjs-mf
to expose a component which relies on NextJS's useRouter. - On the CRA Host, I am using
craco-mf
to connect to the component.
However when running the CRA Host, I am receiving the console error: Uncaught Error: Shared module next/router doesn't exist in shared scope default
Q: How can I resolve this issue? Is this even possible?
References:
- A similar issue was being brought up in a thread within this discussion as well.
Update:
- I am starting to think that I should create a NextJS remote and CRA remote for the same component. Q. Would this be a viable solution?