Skip to content

Commit 2bd1665

Browse files
alan-agius4AndrewKushnir
authored andcommitted
refactor(core): set up framework injector profile exclusively in browser environment (angular#55530)
This commit modifies the setup of the injector profiler to occur solely when the application is running in a browser context. This adjustment is made because the injector profile serves no purpose when the application is running on the server. PR Close angular#55530
1 parent f4f1d32 commit 2bd1665

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/core/src/render3/util/global_utils.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,11 @@ export function publishDefaultGlobalUtils() {
7171
if (!_published) {
7272
_published = true;
7373

74-
setupFrameworkInjectorProfiler();
74+
if (typeof window !== 'undefined') {
75+
// Only configure the injector profiler when running in the browser.
76+
setupFrameworkInjectorProfiler();
77+
}
78+
7579
for (const [methodName, method] of Object.entries(globalUtilsFunctions)) {
7680
publishGlobalUtil(methodName as GlobalUtilsFunctions, method);
7781
}

0 commit comments

Comments
 (0)