Skip to content

ngDevMode is undefined when sharing dependencies #62796

@bh3605

Description

@bh3605

Which @angular/* package(s) are the source of the bug?

platform-browser

Is this a regression?

No

Description

Bug is on this line.

ngDevMode ? 'EventManagerPlugins' : '',

What's happening is an app is running in dev mode and being imported in a website that's been compiled for production leaving devMode out of the compilation. It's an MFE specifying the angular packages are shared dependencies.

I've created a similar bug in the past for ngrx. ngrx/platform#4699

You guys could implement the same fix. https://github.com/ngrx/platform/pull/4703/files

Replace ngDevMode ? 'EventManagerPlugins' : '' with typeof ngDevMode !== 'undefined' && ngDevMode ? 'EventManagerPlugins': ''

If there are similar examples in this repository those should be addressed too to prevent anyone from running across this again.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

Uncaught ReferenceError: application 'my-mfe-application' died in status LOADING_SOURCE_CODE: ngDevMode is not defined

Please provide the environment you discovered this bug in (run ng version)

Angular CLI: 19.2.15
Node: 20.19.1
Package Manager: npm 10.8.2
OS: win32 x64

Angular: 19.2.14
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1902.15
@angular-devkit/build-angular   19.2.15
@angular-devkit/core            19.2.15
@angular-devkit/schematics      19.2.15
@angular/cli                    19.2.15
@schematics/angular             19.2.15
rxjs                            7.8.2
typescript                      5.8.3
zone.js                         0.15.1

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy