Remote Modules can be imported in various ways.
Use React.lazy
and React.Suspense
Using next/dynamic
to import remote modules will cause Hydration Errors
Named Exports require a mocked default
be returned to React.lazy
which expects only default exports.
Eager imports work as well, but it is reccomneded to use dynamic imports when possible to avoid large upfront network transfors or requests
In some cases, you may just want to load a remote module on the client.
For example, if your remote does not provide a commonjs and browser build target.
Node requires a remoteEntry in commonjs format, you cannot provide a browser designated remote to a Server.