question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PWA cannot be configured with the Module Federation

See original GitHub issue

If the application is setup to use the module federation, the bootstrap section of the application is shifted out of the main.ts file into a bootstrap.ts file (https://github.com/angular-architects/module-federation-plugin)

main.ts (in it’s entirety):

import('./bootstrap').catch((err) => console.error(err));

The following function findBootstrapModuleCall doesn’t look into any nested import statements and returns with the error Bootstrap call not found when running ng add @angular/pwa --project myProject: https://github.com/angular/angular-cli/blob/d05559795487095d1b85f27a8159e4adde7b848a/packages/schematics/angular/utility/ng-ast-utils.ts#L54

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
alan-agius4commented, Nov 4, 2021

The Angular PWA schematic is intended to be used with the official builders. Third party tooling can easily extend the schematic functionality and customize it as needed.

The non standard bootstrapping is required by 3rd party builders to use Webpack’s specific features. Both of which are not supported by the Angular team. Please note that Webpack is to be considered an implementation detail in the CLI that can be replaced in the future.

1reaction
manfredsteyercommented, Nov 4, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

PWA for React Micro-Frontend (Module Federation) application
I've setup service workers in both the applications, but given that the service workers of both host and remote apps cannot be registered...
Read more >
Module Federation and Angular Service Workers (PWA) - Bitovi
Using Service Workers on an application that implements Module Federation ensures you have a 100% uptime for all your Remote Containers. Meaning ...
Read more >
How to Use Module Federation with Re.Pack 3 | blog {callstack}
Going through the properties in the Module Federation plugin config, we can find the same ones in all of the apps. The name...
Read more >
@angular-architects/module-federation - npm
Module Federation allows loading separately compiled and deployed code (like micro frontends or plugins) into an application.
Read more >
Webpack 5 Module Federation: A game-changer in JavaScript ...
Let us start out with three standalone applications. App One. Configuration: I'm going to use the app container <App> from App One. It...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found