manfredsteyer / ngx-build-plus

Extend the Angular CLI's default build behavior without ejecting, e. g. for Angular Elements
1.19k stars 136 forks source link

lazy elements module keep loading the MFE in an infinite loop. #386

Closed edgarjoao closed 1 year ago

edgarjoao commented 1 year ago

Hi there, I'm dealing with an issue where the lazy elements keep loading in a infinite loop. I can see the Microfrontend is loaded but forever.

loading

Here is my configuration. Angular v15.2.0 and Angular extensions v15.3.0

Shell App

image image image

Angular config

"build-mfe": {
          "builder": "ngx-build-plus:browser",
          "options": {
            "outputPath": "dist/sales-ui",
            "index": "src/index.html",
            "main": "src/mfe.main.ts",
            "polyfills": [
              "zone.js"
            ],
            "tsConfig": "tsconfig.mfe.json",
            "inlineStyleLanguage": "scss",
            "assets": [
              "src/favicon.ico",
              "src/assets",
              "src/configmaps"
            ],
            "styles": [

            ],
            "scripts": [
            ],
            "aot": true,
            "buildOptimizer": true,
            "optimization": true,
            "sourceMap": false,
            "namedChunks": false,
            "extractLicenses": true,
            "vendorChunk": false,
            "keepPolyfills": false,
            "keepStyles": false,
            "singleBundle": true,
            "outputHashing": "none"
          },
          "configurations": {
            "production": {
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                },
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "6kb"
                }
              ],
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ]
            }
          }
        },
        "serve-mfe": {
          "builder": "ngx-build-plus:dev-server",
          "options": {
            "browserTarget": "sales-ui:build-mfe"
          },
          "configurations": {
            "production": {
              "browserTarget": "sales-ui:build-mfe:production"
            }
          }
        }

Any advice on this issue?