0

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?
clodal
  • 1,615
  • 20
  • 33
  • This question was answered by a module-federation org collaborator brunos3d in Github discussions: https://github.com/module-federation/universe/discussions/494 – clodal Jan 15 '23 at 03:08

0 Answers0