-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Uglified UMD bundle for PlatformBrowser broken #40926
Description
🐞 bug report
Affected Package
@angular/platform-browser
Description
The minimized UMD bundle of @angular/platform-browser cannot be used. If any ngModule imports the BrowserModule an error will be thrown on bootstrap.
Somehow, the prototype of the global exports from platform-Browser will be mangled.
platform-browser.umd.js:

platform-browser.umd.min.js:

Which leads to the injection error shown below.
The other UMD bundles are fine so far.
Is this a regression?
Since I'm probably the only human on earth that uses used those UMD bundles, it's not that high priority I guess.
To put it more precise, I stopped checking after Angular 7
Just wanted to mention this here. Maybe the bug can reveal something interesting to prevent further issues in the future related to minification.
🔬 Minimal Reproduction
Just bootstrap an application importing the minified UMD bundle, e.g.
<script src="node_modules/@angular/platform-browser/bundles/platform-browser.umd.min.js"></script>
🔥 Exception or Error
definition.ts:753 Uncaught Error: Type t does not have 'ɵmod' property.
at getNgModuleDef (definition.ts:753)
at recurse (ng_module_factory_registration.ts:49)
at recurse (ng_module_factory_registration.ts:61)
at registerNgModuleType (ng_module_factory_registration.ts:45)
at new NgModuleFactory (ng_module_ref.ts:121)
at compileNgModuleFactory__POST_R3__ (application_ref.ts:66)
at PlatformRef.bootstrapModule (application_ref.ts:401)
at first.mfe.ts:29
at angular-mfe-first.umd.js:4
at angular-mfe-first.umd.js:5
🌍 Your Environment
Anything else relevant?
Both the usual bundle and the ivy-compiled bundle (running ngcc) have this issue
cheers
flash ⚡

