hass-browser_mod: Settings Page Broken Due To Changes in `ha-data-table` Custom Element
Fix instructions for users
As found by others below:
- Open the file
custom_components/browser_mod/browser_mod_panel.json your Home Assistant instance. - Search for the
ha-data-tableelement in the file and add the attribute.hass=${this.hass}to it. It should look something like<ha-data-table .hass=${this.hass}... - Delete
custom_components/browser_mod/browser_mod_panel.js.gz. - Restart Home Assistant.
My Home Assistant version: 2024.7.1 Frontend: 2024.0705.0
What I am doing: Opening the browser mod settings page.
What I expected to happen: Entire page should load without errors
What happened instead: All of the Frontend Settings dropdowns do not load their content (sidebar order loads partial content). This seems to have been introduced in 2024.7.1, as it was working in 2024.7.0.
Here is the line in the PR which broke it. You need to either provide a localize function or the hass object when using ha-data-table.
Minimal steps to reproduce:
- Install browswer-mod via HACS.
- Open developer tools console.
- Open the browser-mod settings page via the sidebar. Note the repeated errors.
- Scroll to the bottom of the page and expand the frontend settings dropdowns. Note how most of them are empty and/or missing content.
NA
Error messages from the browser console: This error repeasts 30+ times per render.
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'localize')
at i.value (ha-data-table.ts:323:53)
at i.update (lit-element.ts:160:24)
at i.performUpdate (reactive-element.ts:1329:14)
at i.scheduleUpdate (reactive-element.ts:1261:17)
at i._$Ej (reactive-element.ts:1233:25)
By replacing the space in the checkboxes ([ ]) with an X below, I indicate that I:
-
Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).
-
Have made sure I am using the latest version of the plugin.
-
Have followed the troubleshooting steps of the “Common Problems” section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.
-
Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 20
- Comments: 33
Commits related to this issue
- Fix for issue #718 Add hass to data table for localisation. — committed to Alfiegerner/hass-browser_mod by Alfiegerner 2 years ago
- Implement #733. Fix #718 — committed to smartqasa/hass-browser_mod by thomasloven 2 years ago
I was able to fix this with some help of ChatGPT, open
custom_components/browser_mod/browser_mod_panel.jsand changeto:
be aware of your browser cache, I had to restart home assistant a few times as well as reload the browser window a few times.
Here’s my fix, adding the hass object to the same line in
browser_mod_panel.jsfrom @Nerwyn’s other suggestion:The big question is will BM get updated at some point? Today it is this problem but we have another release in a week or so that could break other things. Has this project grown stale? Do alternatives exist?
+1 >> both fix does not work for me.
+1 >> Fix also did not work
That’s what I asked myself. Maybe @thomasloven can give us some updates here?
The fix worked for me in a browser (Safari, iOS) but did not work in the companion app (again, iOS) until I took the extra step of resetting the frontend cache in the app.
Settings > Companion App > Debugging > Reset frontend cache.Then close and re-open the app.Using:
and deleting the browser_mod_panel.js.gz worked for me too, thanks 😃 😃
Deleting the
browser_mod_panel.js.gzas @okleinschmidt mentioned did the trick for me. Before it wasn’t working. I used the substitution from @genehandThanks a lot. Browser Mod is working againg!
Same here, tried both fixes and each time I completely rebooted the HASS Pi then used a private window in both brave and edge browsers. Same error 😦
HASS is on a Pi4
+1