You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to implement a Remix app where one of the routes loads a federated module.
In the linked repo:
package remix-host: the page mfe.tsx at route /mfe will load a federated module
package remote: the module exposes a simple React component via module federation
I was expecting the npm run build command to complete successfully and at runtime the federated component to be consumed properly by the Remix host app
Actual Behavior
The command npm run build fails with the following error
vite v5.4.11 building SSR bundle for production...
✓ 0 modules transformed.
x Build failed in 36ms
[add-entry] ENOENT: no such file or directory, open 'C:\DEV\remix-mf\packages\remix-host\virtual:remix\server-build'
at Object.readFileSync (node:fs:441:20)
at Object.buildStart (C:\DEV\remix-mf\node_modules\@module-federation\vite\lib\index.cjs:109:41)
at file:///C:/DEV/remix-mf/node_modules/rollup/dist/es/shared/node-entry.js:21199:40
at async Promise.all (index 8)
at PluginDriver.hookParallel (file:///C:/DEV/remix-mf/node_modules/rollup/dist/es/shared/node-entry.js:21127:9)
at file:///C:/DEV/remix-mf/node_modules/rollup/dist/es/shared/node-entry.js:22077:13
at catchUnfinishedHookActions (file:///C:/DEV/remix-mf/node_modules/rollup/dist/es/shared/node-entry.js:21545:16)
at rollupInternal (file:///C:/DEV/remix-mf/node_modules/rollup/dist/es/shared/node-entry.js:22074:5)
at Module.build (file:///C:/DEV/remix-mf/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:65443:14)
at viteBuild (C:\DEV\remix-mf\node_modules\@remix-run\dev\dist\vite\build.js:212:5) {
errno: -4058,
code: 'PLUGIN_ERROR',
syscall: 'open',
path: 'C:\\DEV\\remix-mf\\packages\\remix-host\\virtual:remix\\server-build',
pluginCode: 'ENOENT',
plugin: 'add-entry',
hook: 'buildStart'
}
npm error Lifecycle script `build` failed with error:
npm error code 1
npm error path C:\DEV\remix-mf\packages\remix-host
npm error workspace remix-host
npm error location C:\DEV\remix-mf\packages\remix-host
npm error command failed
npm error command C:\windows\system32\cmd.exe /d /s /c remix vite:build
The text was updated successfully, but these errors were encountered:
Yes, Ive also designed the implementation specifically to support federation.
Note its not yet done, i need to ask Jacob a few more questions tomorrow - and smooth out a few other areas, as well and pull over a few more of remix conventions. But its pretty close
Reproduction
In this repo: https://github.com/Shurna83/remix-mf
npm run build
System Info
Used Package Manager
npm
Expected Behavior
I would like to implement a Remix app where one of the routes loads a federated module.
In the linked repo:
remix-host
: the pagemfe.tsx
at route/mfe
will load a federated moduleremote
: the module exposes a simple React component via module federationI was expecting the
npm run build
command to complete successfully and at runtime the federated component to be consumed properly by the Remix host appActual Behavior
The command
npm run build
fails with the following errorThe text was updated successfully, but these errors were encountered: