Skip to content

Commit

Permalink
refactor(core): set up framework injector profile exclusively in brow…
Browse files Browse the repository at this point in the history
…ser environment (#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 #55530
  • Loading branch information
alan-agius4 authored and AndrewKushnir committed Apr 25, 2024
1 parent 9cd633e commit 3ee8618
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/core/src/render3/util/global_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ export function publishDefaultGlobalUtils() {
if (!_published) {
_published = true;

setupFrameworkInjectorProfiler();
if (typeof window !== 'undefined') {
// Only configure the injector profiler when running in the browser.
setupFrameworkInjectorProfiler();
}

for (const [methodName, method] of Object.entries(globalUtilsFunctions)) {
publishGlobalUtil(methodName as GlobalUtilsFunctions, method);
}
Expand Down

0 comments on commit 3ee8618

Please sign in to comment.