Uncaught TypeError: toolbarElement.querySelector(...) is null

Created on 25 June 2025, 14 days ago

Problem/Motivation

Uncaught TypeError: toolbarElement.querySelector(...) is null in
admin_toolbar/js/admin_toolbar.toggle_shortcut.js Line 66

// Create a toggle link to hide the toolbar from the HTML string
// template and insert the toggle link as the last toolbar tab item.
toolbarElement.querySelector('#toolbar-bar').insertAdjacentHTML(
// The toolbar tab item is inserted as the last item in the toolbar.
'beforeend',
Drupal.theme.adminToolbarToggleCollapse(),
);

Needs to check, if #toolbar-bar exists.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024