nrwl / nx

Smart Monorepos ยท Fast CI
https://nx.dev
MIT License
22.69k stars 2.27k forks source link

Endless Angular static remotes building #20973

Closed IKatsuba closed 2 weeks ago

IKatsuba commented 6 months ago

Current Behavior

I have eight Angular remote apps and a host. All of them have the standard configuration by official generators. All apps are built in the dist folder.

Everything is all right if I start nx serve host for the first time (there is no dist).

But if dist exists, the dev server does not start. I endlessly see this message:

image

I found the buildStaticRemotes function in the Angular Module Federation Dev Server. For no reason the exit event fires earlier than the data event.

Expected Behavior

All remotes are built, and the dev server started.

GitHub Repo

No response

Steps to Reproduce

I can't reproduce the same behavior with the statically generated repo. But maybe the exit event has to have a similar handler as the data event?

Nx Report

Node   : 20.10.0
   OS     : darwin-arm64
   npm    : 10.2.3

   nx                 : 17.2.8
   @nx/js             : 17.2.8
   @nx/jest           : 17.2.8
   @nx/linter         : 17.2.8
   @nx/eslint         : 17.2.8
   @nx/workspace      : 17.2.8
   @nx/angular        : 17.2.8
   @nx/cypress        : 17.2.8
   @nx/devkit         : 17.2.8
   @nx/eslint-plugin  : 17.2.8
   @nx/node           : 17.2.8
   @nx/playwright     : 17.2.8
   @nx/plugin         : 17.2.8
   @nx/storybook      : 17.2.8
   @nrwl/tao          : 17.2.8
   @nx/web            : 17.2.8
   @nx/webpack        : 17.2.8
   nx-cloud           : 16.5.2
   typescript         : 5.2.2
   ---------------------------------------
   Community plugins:
   @maskito/angular         : 1.4.0
   @storybook/angular       : 7.6.6
   @taiga-ui/cdk            : 3.26.0
   @taiga-ui/core           : 3.26.0
   @testing-library/angular : 14.5.0

Failure Logs

No response

Package Manager Version

No response

Operating System

Additional Information

No response

jeffschulzusc commented 4 months ago

same here

kevinriemens commented 3 months ago

Same here

MaxSassen commented 3 months ago

image Same here, since this week im stuck on building X static remotes .... not sure if this is the dist folder issue or another (after deleting the dist, its still not working)

pachesnyi commented 3 months ago

Hi, guys. Any updates on this one?

leosvelperez commented 2 months ago

Thanks for reporting this! I'm sorry for the delay in getting to it.

There's little information we can use to reproduce the issue. I tried to reproduce it by creating a workspace with a host and a few remotes (using the official generators) and it's serving the host and static remotes correctly.

Could someone provide a reproduction so we can troubleshoot this?

kevinriemens commented 2 months ago

On thing I've noticed is the following: when doing an nx reset, the static remotes are building. Consecutive runs have this issue. Same behaviour as I've described in this issue: https://github.com/nrwl/nx/issues/22722

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because it hasn't had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

kalpeshhpatel commented 2 months ago

Hi team,

I am facing the similar issue and not able to proceed. Is there any workaround or fix available?

Thanks

Coly010 commented 2 months ago

@kalpeshhpatel Still waiting on a reproduction. If you can provide one that would great

github-actions[bot] commented 2 months ago

This issue has been automatically marked as stale because no reproduction was provided within 7 days. Please help us help you. Providing a repository exhibiting the issue helps us diagnose and fix the issue. Any time that we spend reproducing this issue is time taken away from addressing this issue and other issues. This issue will be closed in 21 days if a reproduction is not provided. If a reproduction has been provided, please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

kevinriemens commented 2 months ago

Reproduction should be possible with:

Node: 18.19.1 OS: darwin-arm64 yarn: 1.22.21 nx: 19.0.4 @nx/js : 19.0.4 @nx/jest : 19.0.4 @nx/linter : 19.0.4 @nx/eslint : 19.0.4 @nx/workspace : 19.0.4 @nx/angular : 19.0.4 @nx/cypress : 19.0.4 @nx/devkit : 19.0.4 @nx/eslint-plugin : 19.0.4 @nrwl/tao : 19.0.4 @nx/web : 19.0.4 @nx/webpack : 19.0.4 typescript : 5.4.3


Community plugins: @ngneat/transloco : 4.1.2 @ngrx/component-store : 17.0.1 @ngrx/effects : 17.0.1 @ngrx/entity : 17.0.1 @ngrx/router-store : 17.0.1 @ngrx/schematics : 17.0.1 @ngrx/store : 17.0.1 @ngrx/store-devtools : 17.0.1

Additional Info

We are using: Angular in NgModule setup, Module Federation, 1x shell 2x remote, 5x libs, SSR.

Issues:

  1. On the first build, the static remotes Builds, but the second remote has trouble finding the correct RemoteEntry, so it messes up the routing/guards for that Remote
  2. On every consecutive run, the Static Remotes build endlessly. It just stuck at the message: Building 2 static remotes...

We had this issue since 17.2+ now.

Currently our only working workaround is configuring the remotes as devRemotes, which works, but is slow af.

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because no reproduction was provided within 7 days. Please help us help you. Providing a repository exhibiting the issue helps us diagnose and fix the issue. Any time that we spend reproducing this issue is time taken away from addressing this issue and other issues. This issue will be closed in 21 days if a reproduction is not provided. If a reproduction has been provided, please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™

MaxSassen commented 1 month ago

was working again until now.. i migrated to 19.1.1:

Node   : 21.5.0
OS     : darwin-x64
npm    : 10.2.4

nx (global)        : 18.0.8
nx                 : 19.1.1
@nx/js             : 19.1.1
@nx/jest           : 19.1.1
@nx/linter         : 19.1.1
@nx/eslint         : 19.1.1
@nx/workspace      : 19.1.1
@nx/angular        : 19.1.1
@nx/cypress        : 19.1.1
@nx/devkit         : 19.1.1
@nx/eslint-plugin  : 19.1.1
@nx/nest           : 19.1.1
@nx/node           : 19.1.1
@nx/playwright     : 19.1.1
@nx/plugin         : 19.1.1
@nrwl/tao          : 19.1.1
@nx/web            : 19.1.1
@nx/webpack        : 19.1.1
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/playwright/plugin
---------------------------------------
Community plugins:
@compodoc/compodoc : 1.1.23
@ngneat/input-mask : 6.1.0
@nx-go/nx-go       : 2.8.0
apollo-angular     : 6.0.0

removed dist / node-modules etc..

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because no reproduction was provided within 7 days. Please help us help you. Providing a repository exhibiting the issue helps us diagnose and fix the issue. Any time that we spend reproducing this issue is time taken away from addressing this issue and other issues. This issue will be closed in 21 days if a reproduction is not provided. If a reproduction has been provided, please reply to keep it active. Thanks for being a part of the Nx community! ๐Ÿ™