Skip to content

Project broke after generating a library (Module Federation) #19706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 of 15 tasks
Al00X opened this issue Jan 3, 2021 · 2 comments
Closed
2 of 15 tasks

Project broke after generating a library (Module Federation) #19706

Al00X opened this issue Jan 3, 2021 · 2 comments

Comments

@Al00X
Copy link

Al00X commented Jan 3, 2021

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

No.

Description

I have an NX Angular project with latest Webpack installed on it. I tried to use Module Federation on this project. Everything is running smoothly but there's a critical issue when adding a library using NX generate to the project.

When you run nx serve after adding a library, you get the error below.

I ignored this error because my application was running just fine; until I tried to build the project using nx build. The project build fails because of this error and cannot get procced.

🔬 Minimal Reproduction

You can take a look at my project and see the error yourself.
https://github.com/adnanebrahimi/angular-module-federation-nx

  1. Clone.
  2. Switch to library branch.
  3. run yarn
  4. run nx s, nx b or npm run start:all

🔥 Exception or Error

./libs/weather/src/index.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/index.js):
Error: The AngularCompilerPlugin was not found. The @ngtools/webpack loader requires the plugin.
    at Object.ngcLoader (...\node_modules\@ngtools\webpack\src\loader.js:29:15)

Error: Conflict: Multiple assets emit different content to the same filename libs_weather_src_index_ts.js

🌍 Your Environment

Angular CLI: 11.0.5
Node: 12.16.3
OS: win32 x64

Angular: 11.0.5
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router
Ivy Workspace: 

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1100.5
@angular-devkit/build-angular   0.1100.5
@angular-devkit/core            11.0.5
@angular-devkit/schematics      11.0.5
@schematics/angular             11.0.5
@schematics/update              0.1100.5
rxjs                            6.5.5
typescript                      4.0.5

Anything else relevant?

@alan-agius4
Copy link
Collaborator

Hi @Al00X,

It appears that you are using 3rd party CLI builders.

While we do allow extending the Angular CLI, we do not provide support for custom Webpack configurations or 3rd party builders.

Support for Module federation is being tracked here: #17556

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants