Problem/Motivation
In #3390178: big_pipe sometimes fails to load blocks we added checkMutation(node.parentNode)
without checking if node.parentNode wasn't NULL.
It can be NULL in certain circumstances
Steps to reproduce
Unsure, this is only reproducible for me on circle CI (when upgrading from 10.2.0 to 10.2.2) so assume it's something with the page/JS speed during tests.
Full stack trace with aggregation disabled
TypeError: Cannot read properties of null (reading 'nodeType')
at checkMutation (http://127.0.0.1:8080/core/modules/big_pipe/js/big_pipe.js?v=10.2.2:92:12)
at checkMutationAndProcess (http://127.0.0.1:8080/core/modules/big_pipe/js/big_pipe.js?v=10.2.2:116:14)
at NodeList.forEach (<anonymous>)
at http://127.0.0.1:8080/core/modules/big_pipe/js/big_pipe.js?v=10.2.2:129:18
at Array.forEach (<anonymous>)
at MutationObserver.processMutations (http://127.0.0.1:8080/core/modules/big_pipe/js/big_pipe.js?v=10.2.2:128:15)
This is during a PHP JS test (using drupal-test-traits with the selenium2 driver), captured using the js_testing_log_test
module.
Proposed resolution
Check node.parentNode
Merge request link
https://git.drupalcode.org/project/drupal/-/merge_requests/6358
Remaining tasks
Figure out how to test if it is testable.
User interface changes
N/a
API changes
N/a
Data model changes
N/a
Release notes snippet
N/a