nx 16 all dev remotes being rebuilt #17085
Labels
outdated
scope: angular
Issues related to Angular support in Nx
scope: react
Issues related to React support for Nx
type: bug
Current Behavior
After update to nx16 I have noticed that all module federation (MF) applications are being rebuilt each time after edit, even without editing them or providing --devRemotes in serve parameter.
Versions 16.0.0 and 16.2.1 seems to have same issue
This started happening on my working project, but I was able to reproduce same behaviour on demo project for MF from nrwl here https://github.com/nrwl/ng-module-federation by migrating to v15/v16/latest (2-3 step migration).
TL;DR: After editing any file (not within MF app) webserver rebuilds all MF apps and bootstraped one.
Providing single --devRemotes target or not providing any has same behaviour, all are being rebuilt.
Tested on node 16.20 and 18.16, same behaviour.
Expected Behavior
Webserver should not rebuild MF apps on hot reload if it is not specified within
--devRemotes
flagGitHub Repo
https://github.com/kyskiz/nx16_remotes_issue
Steps to Reproduce
app.component.ts
Nx Report
Failure Logs
No response
Operating System
Additional Information
Logs starting with successful app serve on localhost:4200 and after single line line on
app.component.ts
as proof that all remotes are being rebuilt after runningnx serve
without providing any--devRemotes
:** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
✔ Compiled successfully.
⠋ Generating browser application bundles...
————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
✔ Browser application bundle generation complete.
✔ Browser application bundle generation complete.
✔ Copying assets complete.
✔ Index html generation complete.
Initial Chunk Files | Names | Raw Size
polyfills.js | polyfills | 137.72 kB |
remoteEntry.mjs | cart | 33.66 kB |
main.js | main | 32.73 kB |
styles.css | styles | 808 bytes |
Lazy Chunk Files | Names | Raw Size
node_modules_angular_core_fesm2022_core_mjs.js | - | 1.17 MB |
default-node_modules_angular_router_fesm2022_router_mjs.js | - | 330.55 kB |
default-node_modules_angular_common_fesm2022_common_mjs.js | - | 286.19 kB |
default-node_modules_angular_common_fesm2022_http_mjs.js | - | 107.36 kB |
default-node_modules_angular_platform-browser_fesm2022_platform-browser_mjs.js | - | 90.25 kB |
default-node_modules_rxjs_dist_esm_internal_observable_from_js-node_modules_rxjs_dist_esm_int-f323a0.js | - | 75.39 kB |
node_modules_tslib_tslib_es6_js.js | - | 16.91 kB |
common.js | common | 13.04 kB |
apps_cart_src_bootstrap_ts.js | bootstrap | 7.00 kB |
| - | 0 bytes |
| - | 0 bytes |
| - | 0 bytes |
| - | 0 bytes |
| - | 0 bytes |
| - | 0 bytes |
Build at: 2023-05-18T14:10:48.368Z - Hash: d0c5c490cc6d0c75 - Time: 4190ms
————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
Nx read the output from the cache instead of running the command for 2 out of 2 tasks.
————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
✔ Browser application bundle generation complete.
✔ Browser application bundle generation complete.
✔ Copying assets complete.
✔ Index html generation complete.
Initial Chunk Files | Names | Raw Size
polyfills.js | polyfills | 137.72 kB |
remoteEntry.mjs | shop | 33.66 kB |
main.js | main | 32.72 kB |
styles.css | styles | 808 bytes |
Lazy Chunk Files | Names | Raw Size
node_modules_angular_core_fesm2022_core_mjs.js | - | 1.17 MB |
default-node_modules_angular_router_fesm2022_router_mjs.js | - | 330.55 kB |
default-node_modules_angular_common_fesm2022_common_mjs.js | - | 286.19 kB |
default-node_modules_angular_common_fesm2022_http_mjs.js | - | 107.36 kB |
default-node_modules_angular_platform-browser_fesm2022_platform-browser_mjs.js | - | 90.25 kB |
default-node_modules_rxjs_dist_esm_internal_observable_from_js-node_modules_rxjs_dist_esm_int-f323a0.js | - | 75.39 kB |
node_modules_tslib_tslib_es6_js.js | - | 16.91 kB |
common.js | common | 13.04 kB |
apps_shop_src_bootstrap_ts.js | bootstrap | 7.00 kB |
| - | 0 bytes |
| - | 0 bytes |
| - | 0 bytes |
| - | 0 bytes |
| - | 0 bytes |
| - | 0 bytes |
Build at: 2023-05-18T14:14:02.624Z - Hash: 5d803d7ed0990cc9 - Time: 2091ms
————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
Nx read the output from the cache instead of running the command for 2 out of 2 tasks.
————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
✔ Browser application bundle generation complete.
✔ Browser application bundle generation complete.
✔ Copying assets complete.
✔ Index html generation complete.
Initial Chunk Files | Names | Raw Size
polyfills.js | polyfills | 137.73 kB |
remoteEntry.mjs | about | 33.67 kB |
main.js | main | 32.74 kB |
styles.css | styles | 811 bytes |
Lazy Chunk Files | Names | Raw Size
node_modules_angular_core_fesm2022_core_mjs.js | - | 1.17 MB |
default-node_modules_angular_router_fesm2022_router_mjs.js | - | 330.56 kB |
default-node_modules_angular_common_fesm2022_common_mjs.js | - | 286.19 kB |
default-node_modules_angular_common_fesm2022_http_mjs.js | - | 107.37 kB |
default-node_modules_angular_platform-browser_fesm2022_platform-browser_mjs.js | - | 90.25 kB |
default-node_modules_rxjs_dist_esm_internal_observable_from_js-node_modules_rxjs_dist_esm_int-f323a0.js | - | 75.39 kB |
node_modules_tslib_tslib_es6_js.js | - | 16.91 kB |
common.js | common | 13.11 kB |
apps_about_src_bootstrap_ts.js | bootstrap | 7.01 kB |
| - | 0 bytes |
| - | 0 bytes |
| - | 0 bytes |
| - | 0 bytes |
| - | 0 bytes |
| - | 0 bytes |
Build at: 2023-05-18T14:14:10.542Z - Hash: ad48645a4a22847c - Time: 3007ms
————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
Nx read the output from the cache instead of running the command for 2 out of 2 tasks.
✔ Browser application bundle generation complete.
Initial Chunk Files | Names | Raw Size
polyfills.js | polyfills | 362.46 kB |
styles.css, styles.js | styles | 257.18 kB |
main.js | main | 37.83 kB |
Lazy Chunk Files | Names | Raw Size
apps_host_src_bootstrap_ts.js | bootstrap | 8.65 kB |
14 unchanged chunks
Build at: 2023-05-18T14:14:57.925Z - Hash: cebb3ef0ab98275d - Time: 4827ms
✔ Compiled successfully.
The text was updated successfully, but these errors were encountered: