{"record":{"id":"913a9b2b000091f8","repo":"angular/angular","slug":"performance-api-is-not-supported-on-this-platform","errorCode":null,"errorMessage":"Performance API is not supported on this platform","messagePattern":"Performance API is not supported on this platform","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/core/src/profiler.ts","lineNumber":67,"sourceCode":"    labelName,\n    startLabel: `start:${labelName}`,\n    endLabel: `end:${labelName}`,\n  };\n}\n\nlet warningLogged = false;\n/**\n * This enables an internal performance profiler\n *\n * It should not be imported in application code\n */\nexport function enableProfiling() {\n  if (\n    !warningLogged &&\n    (typeof performance === 'undefined' || !performance.mark || !performance.measure)\n  ) {\n    warningLogged = true;\n    console.warn('Performance API is not supported on this platform');\n    return;\n  }\n\n  enablePerfLogging = true;\n}\nexport function disableProfiling() {\n  enablePerfLogging = false;\n}\n","sourceCodeStart":49,"sourceCodeEnd":76,"githubUrl":"https://github.com/angular/angular/blob/51cb07e98081ab7e4e84a9e0949266a8e19cca84/packages/core/src/profiler.ts#L49-L76","documentation":"One-time warning from the internal profiler (packages/core/src/profiler.ts): enableProfiling() requires the browser Performance API (performance.mark/measure) to record Angular profiler events. When the platform does not expose it, profiling cannot start; the function logs this warning once (guarded by warningLogged) and returns without enabling. This API is internal and is normally triggered via Angular DevTools, not application code.","triggerScenarios":"Calling enableProfiling() in an environment where the global performance object is missing or lacks mark/measure: Node/SSR runtimes without perf globals exposed, old browsers, or sandboxed/web-worker contexts; typically Angular DevTools or a debugging bootstrap enabling profiling in such an environment.","commonSituations":"Debugging with profiler tooling inside Node-based tests or SSR; legacy browsers in a support matrix; environments where performance was polyfilled away or is read-only.","solutions":["Feature-detect the Performance API before enabling profiling (see validation below)","Run profiling only in a standard browser environment (DevTools attached)","In Node contexts, expose the API first (e.g. import { performance } from 'node:perf_hooks' and set globalThis.performance)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Feature-detect before enabling the profiler (mirrors enableProfiling internals)\nconst performanceAvailable =\n  typeof performance !== 'undefined' &&\n  typeof performance.mark === 'function' &&\n  typeof performance.measure === 'function';\nif (performanceAvailable) {\n  enableProfiling();\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enable profiling only in full browser environments (e.g. with Angular DevTools)","In Node, expose the API first: globalThis.performance = require('node:perf_hooks').performance","Do not import profiler internals in application code"],"tags":["angular","profiler","performance-api","devtools"],"backgroundTag":"performance-api-unavailable","analyzedSha":"51cb07e98081ab7e4e84a9e0949266a8e19cca84","analyzedAt":"2026-08-22T07:04:54.531Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}