Problem/Motivation

On /admin/structure/types/manage/page/fields/node.page.body page we're getting Uncaught TypeError: Cannot read properties of null (reading 'nodeType') error in console.

Steps to reproduce

Go to /admin/structure/types/manage/page/fields/node.page.body
check the console, you will see the error - Uncaught TypeError: Cannot read properties of null (reading 'nodeType')

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3413079

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Gauravvvv created an issue. See original summary.

gauravvvv’s picture

gauravvvv’s picture

Status: Active » Needs review
prashant.c’s picture

Thanks for raising and the fix @Gauravvvv. Yes, I am also able to reproduce this issue, however this JS error appears on every content type not specifically on "Basic page" only.

Added comments in the MR.

Thank you.

cilefen’s picture

Is this reproducible on a clean install?

prashant.c’s picture

@cilefen Yes, at-least I got this error on clean 11.x install.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs tests

Issue summary is incomplete

Will need steps to reproduce + tests.

casey’s picture

StatusFileSize
new724 bytes

Static patch file of MR up until #4 for use with composer-patches

jox’s picture

I'm getting this error also when editing a node e.g. at /node/16/edit. The patch fixes it there as well.

rajab natshah’s picture

Facing the same issue with Drupal 10.2.1

Uncaught TypeError: Cannot read properties of null (reading 'nodeType')
    at checkMutation (big_pipe.js?v=10.2.1:92:12)
    at checkMutationAndProcess (big_pipe.js?v=10.2.1:116:14)
    at NodeList.forEach (<anonymous>)
    at big_pipe.js?v=10.2.1:129:18
    at Array.forEach (<anonymous>)
    at MutationObserver.processMutations (big_pipe.js?v=10.2.1:128:15)

Patch #9 fixed the issue

rajab natshah’s picture

mauzilla’s picture

Getting the same error in Drupal 10.2 - Seems to affect all admin pages

jennypanighetti’s picture

Patch #9 seems to have fixed it for my admin pages as well - 10.2.1 and 10.2.2

Hardik_Patel_12 made their first commit to this issue’s fork.

hardik_patel_12’s picture

hardik_patel_12’s picture

Status: Needs work » Needs review
hardik_patel_12’s picture

Status: Needs review » Needs work

Returning to "needs work" as a test is required.

gerzenstl’s picture

I can confirm the MR #6057 works.

I tested on Drupal 10.2.1

vakulrai made their first commit to this issue’s fork.

vakulrai’s picture

Status: Needs work » Needs review

Re-rolled patch as its reproducible for 11.x branch and for the tests as the errors are more due to the JS mutation observer is missing a check and the error in the console cant be tracked in the Tests so can anyone suggest a way to have a test coverage here Else we can move this ticket forward.

Thanks!

albeorte’s picture

StatusFileSize
new4.13 KB

I have tested the added changes and they work correctly! RTBC

I add the new changes in file.patch format

albeorte’s picture

Status: Needs review » Reviewed & tested by the community
acbramley’s picture

Status: Reviewed & tested by the community » Needs work

Marked #3417672: big_pipe JS checkMutation can throw type errors if parentNode is NULL as a duplicate. This still needs tests. Please keep work in the MR, patches are not required here.

herved’s picture

StatusFileSize
new1.14 KB

I'm seeing this on Drupal 10.2.3 as well, issue #3390178: big_pipe sometimes fails to load blocks got included in 10.2.1 so I guess it makes sense.
The error is almost on all pages for me. It seems one of my browser extensions (Scraper 1.7, on brave, which I now disabled as I'm not using it) is causing DOM mutations on the body element, which triggers this.

big_pipe needs to be more resilient. The MR fixes it.
I'll add a static diff patch of it (latest commit 6580c866), for composer, in case anyone else needs it.

acbramley’s picture

Status: Needs work » Closed (duplicate)
Issue tags: -Needs steps to reproduce, -Needs tests