Error when creating app NgModule. Module created with module-federation

25 Views Asked by At

I am building an application based on angular module federation, with serveral modules. In a monorepo, I have several modules, structured like this.

apps
  |_name_of_repo
      |_src
          |_ app
              |_module_1
              |   |_package.json
              |   |_tsconfig.json
              |   |_webpack.config.js
              |   |_main.ts
              |   |_bootstrap.ts
              |   |_OTHER_FOLDERS_CONTAINING_COMPONENTS_OR_VIEWS
              |_module_2
                  |_package.json
                  |_tsconfig.json
                  |_webpack.config.js
                  |_main.ts
                  |_bootstrap.ts
                  |_OTHER_FOLDERS_CONTAINING_COMPONENTS_OR_VIEWS

In my angular.json file, I can specify several configurations to build either module_1 or module_2 separately, in order to end up with different binaries for each module with the code built isolated.

My problem comes with some weird error I'm having only some times. The error is the following, and appears only with some modules, when trying to load the module.

Error when creating app NgModule:  TypeError: Cannot read properties of undefined (reading 'call')
    at r (remoteEntryModule1.js:1:541)

I have no idea on what might be the root cause for this, anyone has experienced something similar and can help?

Thanks in advance

0

There are 0 best solutions below