nx icon indicating copy to clipboard operation
nx copied to clipboard

Module Federation - content of vendor.js repeated in polyfills.js

Open hardikpatel043 opened this issue 1 year ago • 5 comments

Current Behavior

I created nx workspace and then created shell and remote app using below command.

nx g @nx/angular:host shell --directory=apps/angular/with-remotes/shell --remotes=remote1

This created shell and remote1 app.

I ran shell and remote app using "nx serve shell". This served shell on 4200 port.

When i checked network tab i saw polyfills and vendor files has loaded.

image

I checked content of both file and found that content of vendor.js is repeated in polyfill.js

https://www.diffchecker.com/0XyPfraG/

Expected Behavior

vendor.js files content should not be repeated in polyfills.js

GitHub Repo

https://github.com/hardikpatel043/nx-module-federation

Steps to Reproduce

  1. create nx workspace. "npx create-nx-workspace"
  2. create shell and remote app. "nx g @nx/angular:host shell --directory=apps/angular/with-remotes/shell --remotes=remote1"
  3. run app "nx serve shell"
  4. Check vendor.js and polyfills.js in network tab.

Nx Report

>  NX   Its time to update Nx 🎉

   Your repository uses a higher version of Nx (18.0.4) than your global CLI version (17.0.2)
   For more information, see https://nx.dev/more-concepts/global-nx


 >  NX   Report complete - copy this into the issue template

   Node   : 18.18.2
   OS     : win32-x64
   npm    : 9.8.1

   nx (global)        : 17.0.2
   nx                 : 18.0.4
   @nx/js             : 18.0.4
   @nx/jest           : 18.0.4
   @nx/linter         : 18.0.4
   @nx/eslint         : 18.0.4
   @nx/workspace      : 18.0.4
   @nx/angular        : 18.0.4
   @nx/cypress        : 18.0.4
   @nx/devkit         : 18.0.4
   @nx/eslint-plugin  : 18.0.4
   @nrwl/tao          : 18.0.4
   @nx/web            : 18.0.4
   @nx/webpack        : 18.0.4
   typescript         : 5.3.3

Failure Logs

No response

Package Manager Version

No response

Operating System

  • [ ] macOS
  • [ ] Linux
  • [X] Windows
  • [ ] Other (Please specify)

Additional Information

No response

hardikpatel043 avatar Feb 22 '24 08:02 hardikpatel043