Cannot read properties of null (reading 'querySelectorAll') in 2025.5.0
I just updated to HA 2025.5.0 and now the redirect is not rendered and an error is shown instead:
Same here. The display shows Tabs is null.
I managed to fix the issue by doing these changes:
- Edit 'www/community/lovelace-tab-redirect-card/tab-redirect-card.js' using Visual Studio Code/notepad.
- Look for
let tabs = uiRoot.shadowRoot.querySelector('ha-tabs');
if(!tabs) {
tabs = uiRoot.shadowRoot.querySelector('paper-tabs');
}
const tabList = tabs.querySelectorAll('paper-tab');
- replace with:
let tabs = uiRoot.shadowRoot.querySelector('sl-tab-group');
const tabList = tabs.tabs;
- update javascript version : settings > dashboards > '. . .' > resources : update the querystring hacstag to something else.
No Luck here.
I have the same problem since 2025.5
`type: grid cards:
- type: custom:tab-redirect-card
redirect:
- user: nspanel entity_id: light.spots entity_state: "on" redirect_to_tab_index: 0
- user: nspanel entity_id: light.schemerlampen entity_state: "on" redirect_to_tab_index: 0`
is this project still active? I do not see activities for years.
I tried the solution from spemme - no result. Still the same issue
@Pirol62 : Odd that it's working for me. It's crucial that the version of the resource is changed, otherwise Home assistant will never serve the new javascript.
I did that. Changed to '/hacsfiles/lovelace-tab-redirect-card/tab-redirect-card.js?hacstag=55' and even restarted HA
Ok, I solved my issue with browser_mod.
I have changed mine to the following and it works.
let tabs = uiRoot.shadowRoot.querySelector('sl-tab-group');
if(!tabs) {
tabs = uiRoot.shadowRoot.querySelector('paper-tabs');
}
const tabList = tabs.querySelectorAll('sl-tab');
I did that. Changed to '/hacsfiles/lovelace-tab-redirect-card/tab-redirect-card.js?hacstag=55' and even restarted HA
What is 55? The same for any installation?
Ok, I solved my issue with browser_mod.
Same here. I gave up. It's goodbye tab redirect.
The solution posted by @spemme worked for me. Thanks!
I made this change in my fork. Feel free to install via HACS: https://github.com/evansalter/lovelace-tab-redirect-card
I've also opened a PR to this repo. @ben8p can you merge? https://github.com/ben8p/lovelace-tab-redirect-card/pull/14