'Module Federation - Uncaught SyntaxError: Unexpected token ':' Angular 13 while consuming MFE

I am trying to consume an MFE using webpack 5, module federation with angular 13. However when I run the application I am getting below error.

Uncaught SyntaxError: Unexpected token ':'

Error occurring with the below code in webpack.config

 new ModuleFederationPlugin({
      name: "shell",
      filename: "remoteEntry.js",           
      remotes: {
                MfeAccount: "https://account-mfexyz.com/remoteEntry.js"
              },
})

To me everything looks good, but still application not able to access remote MFE, and throwing error.

Please assist.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source