Skip to content

core(gather): handle missing DOM resolve objects#17027

Open
KirtiRamchandani wants to merge 1 commit into
GoogleChrome:mainfrom
KirtiRamchandani:fix/anchor-elements-missing-object
Open

core(gather): handle missing DOM resolve objects#17027
KirtiRamchandani wants to merge 1 commit into
GoogleChrome:mainfrom
KirtiRamchandani:fix/anchor-elements-missing-object

Conversation

@KirtiRamchandani
Copy link
Copy Markdown

Problem

  • The AnchorElements gatherer can crash with "Cannot read properties of undefined (reading 'objectId')" when Chrome returns a DOM.resolveNode response without a Runtime remote object for an anchor node.

Root cause

  • The shared DOM resolver destructured resolveNodeResponse.object.objectId unconditionally. Existing missing-node handling only covered protocol errors, not a successful-but-empty resolve response.

Solution

  • Treat a missing Runtime object the same as other missing node cases by returning undefined from both DOM resolver helpers.
  • Add regression coverage for backend-node and DevTools-node-path resolution responses without objects.

Tests run

  • corepack yarn mocha --testMatch core/test/gather/driver/dom-test.js
  • .\node_modules\.bin\eslint.cmd --quiet core\gather\driver\dom.js core\test\gather\driver\dom-test.js
  • git diff --check

Fixes #16860

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AnchorElements - Cannot read properties of undefined (reading 'objectId')

1 participant