angular-architects / module-federation-plugin

MIT License
728 stars 197 forks source link

Module Federation with Angular Universal #250

Open sir-captainmorgan21 opened 2 years ago

sir-captainmorgan21 commented 2 years ago

When following the tutorial here: https://github.com/angular-architects/module-federation-plugin/blob/main/libs/mf/README.md#angular-universal-server-side-rendering

I get the error below when running the server command.

ng build shell && ng run shell:server

I am on angular 14 and @nguniversal/common 14

./apps/shell/src/server.ts:1:0-100 - Error: Module not found: Error: Package path ./clover/server/src/custom-resource-loader is not exported from package /Users/zach.morgan/Development/mfe-universal/node_modules/@nguniversal/common (see exports field in /Users/zach.morgan/Development/mfe-universal/node_modules/@nguniversal/common/package.json)

Error: apps/shell/src/server.ts:1:38 - error TS2307: Cannot find module '@nguniversal/common/clover/server/src/custom-resource-loader' or its corresponding type declarations.

1 import { CustomResourceLoader } from '@nguniversal/common/clover/server/src/custom-resource-loader';
sir-captainmorgan21 commented 2 years ago

I think similar issue found here in universal's repo: https://github.com/angular/universal/issues/2599

sir-captainmorgan21 commented 2 years ago

@veer345 were you ever able to figure this out?

manfredsteyer commented 1 year ago

I'm going to look into this when updating the lib on Angular 15 soon.

vmagalhaes commented 1 year ago

Hi @manfredsteyer, any updates regarding this? I'm trying to use SSR with my application but with no success.

Will be nice if you can create a article explaining how to use Module Federation and SSR, with Angular 16 and the hydration this will be a really nice topic.

rpanadero commented 1 year ago

any updates regarding this? Please, @manfredsteyer , give us some feedback

Marbulinek commented 9 months ago

Hi @manfredsteyer, any updates regarding this? I'm trying to use SSR with my application but with no success.

Will be nice if you can create a article explaining how to use Module Federation and SSR, with Angular 16 and the hydration this will be a really nice topic.

Also for native-federation, it will be very helpfull.

giri-sh-irke commented 1 month ago

Hi @manfredsteyer, Even I am struggling to setup up Module Federation in an existing Angular Universal project. I am not able to load an SSR MFE in the SSR host. Also, the next problem that I can guess is data sharing between these. Any references/guidelines would be beneficial.