Skip to content

I receive (__webpack_exports__ is not defined ) in angular version >20.2.0 while using module federation #419

@kindy91

Description

@kindy91

Hello,

I already opened an issue in angular community and it was mentioned that it is a bundling issue.
angular/angular#63413

Conent

When i try to migrate to angular version >20.2.0, i started receiving an error where i can't open the microfrontend i have due to the following error.

Image

Moreover, this error is not reproducable when serving the frontends locally, however it only appears on the deployed version. I doubted that maybe:

  • Some cors errors are happenning, but it looks fine.
  • The js chunks and remote entry are being loaded in the correct order, but maybe they are being executed in a different order. I am not sure.

To give a clearer image of the settings i have, check the following repos i created.
https://github.com/kindy91/shell
https://github.com/kindy91/mf1

The shell loads the routes of the microfrontend and injects them. The error happens when routing to the mf routes from the shell and happens only on the deployed version, not locally.

Finally, i give you the exact library updates that bring this about.

Image Image

I am not sure where is the problem here to be honest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions