Skip to content

core/caniuse silently drops the browser-support table when .head dl is missing #5370

Open

Description

@marcoscaceres

In src/core/caniuse.js, the browser-support table is appended with an optional-chaining call:

const headDlElem = document.querySelector(".head dl");
// ...
headDlElem?.append(...definitionPair.childNodes);

If .head dl is absent, the ?. swallows the failure and the module carries on, so the entire caniuse browser-support table is silently dropped. The author gets no warning that the feature they configured produced nothing.

The sibling module handles the same situation correctly. In src/core/implementation-status.js:

if (!headDlElem) return;

That returns early rather than continuing with work that cannot land anywhere.

Worth making caniuse either report the problem via showError/showWarning or return early the way implementation-status does, instead of failing silently.

Noted while upgrading TypeScript, which flagged a related unguarded querySelector result further down the same function. That guard is being fixed separately; this one is the pre-existing case and is not a regression.

Activity

  1. added a commit that references this issue on Jul 29, 2026
    87d441a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions