Skip to content

PerformanceObserver.observe(): compatibility table is misleading — does not distinguish Level 1 (entryTypes) vs Level 2 (type+buffered) syntax, caused production breakage #43635

@827652549

Description

@827652549

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/PerformanceObserver/observe

What specific section or headline is this issue about?

Code example and Browser compatibility table

What information was incorrect, unhelpful, or incomplete?

The code example uses the Level 2 syntax ({ type, buffered }) without any warning:

observer.observe({ type: "resource", buffered: true });

This throws a runtime TypeError on older browsers (e.g. Android 9 WebView, iOS 12 Safari) that only support the Level 1 syntax ({ entryTypes: [...] }).

Additionally, the Browser Compatibility table shows observe() is supported from Safari 11 / iOS 11, but this only reflects support for the Level 1 signature. The Level 2 signature ({ type, buffered }) has a narrower support range that is not separately represented in the table.

The combination of a Level 2 example and a table that appears to show broad support is misleading.

What did you expect to see?

Either:

  1. The example uses the safer Level 1 syntax (entryTypes), or shows both syntaxes with a feature-detect fallback
  2. A compatibility warning noting that { type, buffered } requires Level 2 support (not available in Safari < 14, Chrome WebView < ~73)
  3. Separate BCD entries for the type and buffered options so developers can see the real support range

Do you have any supporting links, references, or citations?

Do you have anything more you want to share?

Reproduction steps (verified on Android 9):

  1. Start an Android 9 emulator (API 28) via Android Studio AVD Manager
  2. Open https://7fznjs.csb.app/ in the browser
  3. Inspect via chrome://inspect on desktop Chrome
  4. Error in Console: "Uncaught TypeError: Failed to execute 'observe' on 'PerformanceObserver': required member entryTypes is undefined."
Image

Environment: Android 9 (PSR1.210301.009.B1), WebView Chrome 66.0.3359.158

iOS 12 was also affected — confirmed at the time via a real enterprise device — but cannot be re-verified now as iOS 12 simulators require Xcode 13 (incompatible with newer macOS), and cloud platforms like BrowserStack no longer support iOS 12.

This issue caused a production white screen in an enterprise app. The misleading compatibility table was the primary reason the bug went unnoticed during development.

Metadata

Metadata

Assignees

No one assigned

    Labels

    to moveIf the issue doesn't belong in Content but elsewhere in the MDN org

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions