Skip to content
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

Module Federation buid stuck on "building" phase (forever) #20429

Closed
2 of 15 tasks
glebmachine opened this issue Apr 1, 2021 · 6 comments
Closed
2 of 15 tasks

Module Federation buid stuck on "building" phase (forever) #20429

glebmachine opened this issue Apr 1, 2021 · 6 comments

Comments

@glebmachine
Copy link

🐞 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?

It's early version bug

Description

When internal library added as shared dependency, my build stuck on building phase (tested for an hour long)

When something brokes inside building phase would be great to have error message with stack trace

🔬 Minimal Reproduction

Repro:

  1. git clone [email protected]:glebmachine/module-federation-build-stuck.git
  2. yarn
  3. ./node_modules/.bin/ng run shell:serve

🔥 Exception or Error

Just always hang on building phase

🌍 Your Environment

Angular CLI: 11.0.3
Node: 12.14.1
OS: win32 x64

Angular: 11.0.3
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1001.7
@angular-devkit/build-angular   0.1100.0
@angular-devkit/core            11.0.3
@angular-devkit/schematics      11.0.3
@schematics/angular             11.0.3
@schematics/update              0.1100.3
ng-packagr                      11.2.4
rxjs                            6.6.6
typescript                      4.0.6



Anything else relevant?

@alan-agius4
Copy link
Collaborator

Hi @glebmachine,

Thanks for opening this issue. While the Angular CLI allows extending the Webpack configuration by doing so you are venturing on the unsupported path as Angular tooling team doesn't provide support for builds using custom Webpack configurations.

I suggest that you file an issue https://github.com/angular-architects/module-federation-plugin and raise an issue with the author of this package. If is indeed an Angular CLI issue which cannot be solved by the above mentioned 3rd party package please feel

@glebmachine
Copy link
Author

glebmachine commented Apr 4, 2021

@alan-agius4 Unfortunately, this is not

I found that if build phase stuck with .ts extenion at the and of an shared dependency import path
(also i checked vanilla webpack + module federation build - everything works fine, proof)

I think it's one of the angular-cli devkit extensions, that breaks compilation process silently

Here updated by example, with ultra clean repro (inly cli and Module Federation)
https://github.com/glebmachine/module-federation-build-stuck

Steps to reproduce:

  1. git clone [email protected]:glebmachine/module-federation-build-stuck.git
  2. yarn
  3. ./node_modules/.bin/ng run shell:serve
  4. It hangs
  5. Remove unnecessary .ts extension (screenshot below) and run again (wuola! Building phase completes)
    image

@glebmachine
Copy link
Author

@alan-agius4 please, reopen

@alan-agius4
Copy link
Collaborator

Hi, @glebmachine,

Following some further discussion with @clydin.

Webpack 5 is still experimental in v11 and even without that, modifying the internal Webpack configuration in complex ways is not guaranteed to work nor supported.

If you’d like to troubleshoot and come up with a fix, we can evaluate it, but Webpack 5 should be expected to not be fully functional in v11.

@glebmachine
Copy link
Author

glebmachine commented Apr 4, 2021

Yeah, i'm not expecting that, but in 12 preview build it emits zero sized bundle and don't serve anything
(you can find more information here #20428)

I'm just trying to find the way to run module federation, and brings you some bugs. as early adopter
I hope you implement module federation support because angular is about big enterprise applications, which need to be splitted into microfrontends.

About "modifying the internal Webpack configuration"
It's just built-in webpack plugin (module federation). It's not some huge modification. Just single canonical webpack config.

Microfrontends is very important thing in 2021 and module federation - key feature for implementing them, don't dismiss that, maybe @clydin have some thoughts about that, or reasons not to support module federation in angular ecosystem?

Related to feature request: #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 May 5, 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