fix(devtools): prod app detected screen

Do not call `getSupportedApis` in a prod app since it throws an error due to the absence of `ng`, which prevents the FE from getting the `ngAvailability` message and, respectively, the proper info screen that DevTools cannot be used on a prod app.
This commit is contained in:
hawkgs
2025-12-03 17:55:03 +02:00
committed by Alex Rickabaugh
parent 7efc6f0086
commit 0c4a5c599d
3 changed files with 9 additions and 4 deletions
@@ -339,13 +339,15 @@ const checkForAngular = (messageBus: MessageBus<Events>): void => {
initializeOrGetDirectiveForestHooks();
}
const devMode = appIsAngularInDevMode();
messageBus.emit('ngAvailability', [
{
version: ngVersion.toString(),
devMode: appIsAngularInDevMode(),
devMode,
ivy: appIsIvy,
hydration: isHydrationEnabled(),
supportedApis: getSupportedApis(),
supportedApis: devMode ? getSupportedApis() : null,
},
]);
};
@@ -100,7 +100,10 @@ export class DevToolsComponent implements OnDestroy {
this.ivy.set(ivy);
this._interval$.unsubscribe();
this.hydration.set(hydration);
this.supportedApis.init(supportedApis);
if (supportedApis) {
this.supportedApis.init(supportedApis);
}
});
}
@@ -385,7 +385,7 @@ export interface Events {
devMode: boolean;
ivy: boolean;
hydration: boolean;
supportedApis: SupportedApis;
supportedApis: SupportedApis | null;
}) => void;
inspectorStart: () => void;