diff --git a/packages/core/src/render3/util/global_utils.ts b/packages/core/src/render3/util/global_utils.ts index e96704672b873f..cfb4aa05be4b70 100644 --- a/packages/core/src/render3/util/global_utils.ts +++ b/packages/core/src/render3/util/global_utils.ts @@ -71,8 +71,9 @@ export function publishDefaultGlobalUtils() { if (!_published) { _published = true; - if (typeof window !== 'undefined') { - // Only configure the injector profiler when running in the browser. + // Only configure the injector profiler when running in the browser and WeakRef is defined. + // In some G3 test WeakRef is undefined as they user older (unsupported) browsers to test. + if (typeof window !== 'undefined' && typeof WeakRef !== 'undefined') { setupFrameworkInjectorProfiler(); }