angular-architects / module-federation-plugin

MIT License
698 stars 190 forks source link

Native Federation - isDevMode() always returns FALSE #552

Open vladyslavsemenets opened 2 months ago

vladyslavsemenets commented 2 months ago

Hi,

I'm using the @angular-architects/native-federation package, and I noticed when I build an application for local development (then I serve files via express), ngDevMode is undefined and isDevMode() always returns FALSE, and we can't set dev to TRUE in angular.json.

I noticed that here you are just checking the dev variable:

https://github.com/angular-architects/module-federation-plugin/blob/main/libs/native-federation/src/utils/angular-esbuild-adapter.ts#L304

if we set dev as TRUE we will get this error

[error] TypeError: Cannot read properties of undefined (reading 'split') at targetFromTargetString (/node_modules/@angular-devkit/architect/src/api.js:58:29) at runBuilder_1 (/mfe1/node_modules/@angular-architects/native-federation/src/builders/build/builder.js:57:61) at runBuilder_1.next () at resume (/mfe1/node_modules/tslib/tslib.js:281:48) at fulfill (//mfe1/node_modules/tslib/tslib.js:283:35)

How can I fix this?

jsenzig-clgx commented 1 month ago

Is this possibly related to https://github.com/angular-architects/module-federation-plugin/issues/458?