Skip to content

Uglified UMD bundle for PlatformBrowser broken #40926

@flash-me

Description

@flash-me

🐞 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:
image
platform-browser.umd.min.js:
image
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

image

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

image

Anything else relevant?
Both the usual bundle and the ivy-compiled bundle (running ngcc) have this issue

cheers
flash ⚡

Metadata

Metadata

Assignees

No one assigned

    Labels

    P5The team acknowledges the request but does not plan to address it, it remains open for discussionarea: packagingIssues related to Angular's creation of npm packages

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions