Uncaught TypeError: document.querySelector is null

Created on 24 June 2024, 3 months ago
Updated 14 August 2024, 24 days ago

Problem/Motivation

After upgrading to drupal core 10.1.x that is many errors in the console like

Uncaught TypeError: document.querySelector(...) is null
and

    Uncaught TypeError: Drupal.toolbar is undefined

And this makes the toolbar misplaced.
It seems that inside the Toolbar.js file, there is a missing class 'toolbar-oriented' in the toolbar:

if (isOriented) {
      document
        .querySelector('#toolbar-administration')
        .classList.add('toolbar-oriented');
    }

I could reproduce this issue using landing pages builder with layout builder.
But also document.querySelector('#toolbar-administration').classList.add('toolbar-oriented') is giving null using Claro admin theme.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
ToolbarΒ  β†’

Last updated 4 days ago

  • Maintained by
  • πŸ‡«πŸ‡·France @nod_
Created by

πŸ‡¦πŸ‡·Argentina andreadruiz Buenos Aires

Live updates comments and jobs are added and updated live.
  • JavaScript

    Affects the content, performance, or handling of Javascript.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024