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 followed the steps on https://nx.dev/recipes/react/module-federation-with-ssr to setup a basic SSR workspace. I removed the checkout remote and cleaned some stuff up. It was all working up until the point that I want to just render out the HTML provided by SSR, based upon a remote component.
If you run the nx run store:serve:development --verbose command and go to http://localhost:4200/v2 - you'll see that there is no output from the server. Just the error below. While I would just expect it the have the html output from the component wrapped in a <div id="root"></div>.
Error: Cannot find module '/Users/xxxx/Projects/xxx/my-test/node_modules/@module-federation/sdk/dist/dist/index.cjs.js'
at createEsmNotFoundErr (node:internal/modules/cjs/loader:1182:15)
at finalizeEsmResolution (node:internal/modules/cjs/loader:1170:15)
at trySelf (node:internal/modules/cjs/loader:559:12)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1122:24)
at Function.Module._load (node:internal/modules/cjs/loader:986:27)
at Function.Module._load (/Users/xxx/Projects/xxx/my-test/node_modules/@nx/js/src/executors/node/node-with-require-overrides.js:18:31)
at Module.require (node:internal/modules/cjs/loader:1233:19)
at require (node:internal/modules/helpers:179:18)
at Object.29 (remoteEntry.js:480:18)
at __webpack_require__ (remoteEntry.js:550:32) {
code: 'MODULE_NOT_FOUND',
path: '/Users/xxx/Projects/xxx/my-test/node_modules/@module-federation/sdk/dist/package.json'
}
Package Manager Version
4.5.0 ( yarn )
Operating System
macOS
Linux
Windows
Other (Please specify)
Additional Information
My end goal is to have module federated SSR service which just outputs the component HTML and returns it in a response. The reason is that this service is called by a CMS system and all the frontend/browser related stuff is handled there. Not in the SSR service.
The text was updated successfully, but these errors were encountered:
@KyorCode Thanks for raising this. I believe this is an issue on the Module Federation side. Good spot on the double dist/ in the string. I'll speak with Zack Jackson and take a look over on that repo to see if i can resolve this myself.
Current Behavior
I followed the steps on https://nx.dev/recipes/react/module-federation-with-ssr to setup a basic SSR workspace. I removed the checkout remote and cleaned some stuff up. It was all working up until the point that I want to just render out the HTML provided by SSR, based upon a remote component.
If you run the
nx run store:serve:development --verbose
command and go to http://localhost:4200/v2 - you'll see that there is no output from the server. Just the error below. While I would just expect it the have the html output from the component wrapped in a<div id="root"></div>
.The normal http://localhost:4200 just works fine.
What I noticed in the error is that there is a double
/dist/dist/
in there, which I presume to be a bug of some sorts.Expected Behavior
Being able to output plain html from a SSR service.
GitHub Repo
https://github.com/KyorCode/nx-mf-test
Steps to Reproduce
nx run store:serve:development --verbose
Nx Report
Failure Logs
Package Manager Version
4.5.0 ( yarn )
Operating System
Additional Information
My end goal is to have module federated SSR service which just outputs the component HTML and returns it in a response. The reason is that this service is called by a CMS system and all the frontend/browser related stuff is handled there. Not in the SSR service.
The text was updated successfully, but these errors were encountered: