Skip to content

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

Closed

Description

@glebmachine

🐞 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 git@github.com: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?

Activity

  1. alan-agius4 commented on Apr 2, 2021

    @alan-agius4
    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

  2. glebmachine commented on Apr 4, 2021

    @glebmachine
    Author

    @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 git@github.com: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
  3. glebmachine commented on Apr 4, 2021

    @glebmachine
    Author

    @alan-agius4 please, reopen

  4. alan-agius4 commented on Apr 4, 2021

    @alan-agius4
    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.

  5. glebmachine commented on Apr 4, 2021

    @glebmachine
    Author

    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

  6. angular-automatic-lock-bot commented on May 5, 2021

    @angular-automatic-lock-bot

    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.

  7. locked and limited conversation to collaborators on May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions