NF-030: Remote component server code required a module the host does not provide
A remote build's server code called require() for a module the host does not hand out. The host resolves only the remote's own files and...
Why This Error Occurred
A remote build's server code called require() for a module the host does not hand out. The host resolves only the remote's own files and @module-federation/runtime, so the component renders in the browser only. Remote components run on the host's React, and a second copy would fail with "Invalid hook call".
Possible Ways to Fix It
-
Build the remote with
nextFederationComponents, which treats React,react-domandreact/jsx-runtimeas host-provided. -
List every other package the host owns in the remote's
sharedoption and in the host'screateRemoteComponent({ shared }):shared: { '@acme/ui': { version: '2.4.0', module: AcmeUi } } -
Leave packages only the remote uses out of
shared. They are bundled into its chunks.
Useful Links
NF-029: Remote component failed to load
A remote component could not be loaded: its build descriptor could not be fetched or is invalid, or its module failed to load on the server or in the...
NF-031: Server Action not found
The remote answered a Server Action request with 404: the id in the X-NF-Action header is not a 'use server' function in the build that served the...