Broken camera image, can't load /webrtc/webrtc-camera.js?v2.3.1

Hello. This is my first topic, if I do something isn’t right with my post, tell me and I will fix it. And sorry for my bad English, it’s not my native language.
My HA instace gets anoying problem with camera entities, which isn’t displaying pictures. On dashboard, it just load for a while then display broken-image.svg, or turn blank. A dashboard with 14 cameras, only 1-4 ones work.


The browser split out bunch of error in console, seem relate to WebRTC (see logs below). As I recall, I installed custom integration WebRTC from HACS a long time ago and removed it after HA support it natively and I just didn’t use it much.
Camera entities are provided by Local file integration. Files store at /share/tmp and mounted as tmpfs by host OS, update intervally (20s - 1min) by custom systemd services i wrote.
I can view images on my desktop over SAMBA share. To make sure it not problem with images, I install a HA container on my destop to test with exact these files and no problem or error in browser console.
Any one have idea how to fix this?

Version: 2025.2.2
Type: Supervised 2025.03.2
Frontend: 20250210.0
OS: Debian 12
HACS: 2.0.5, installed: pexcharts-card, multiple-entity-row, fold-entity-row, template-entity-row.
Custom integration: None

Tried (but not work):

  • Clear browser data.
  • Install WebRTC from HACS, then remove
  • Remove HACS. It break fontend so I had to reinstall HACS and custom dasboard elements

Happen on:

  • Firefox/Windows 10, Firefox/Debian 12 Gnome, Chrome/Windows 10: broken 90% of the time
  • Companion App/Android 12: maybe 10%.

Browser console logs:

Failed to load ‘https://redacted.duckdns.org:8123/api/camera_proxy_stream/camera.hometown_ipc_lvr_snapshot?token=<>’. A ServiceWorker intercepted the request and encountered an unexpected error. sw-modern.js:1:52029
Failed to load ‘https://redacted.duckdns.org:8123/api/camera_proxy_stream/camera.hiha_ipc_font_snapshot?token=<>’. A ServiceWorker intercepted the request and encountered an unexpected error. sw-modern.js:1:52029
Failed to load ‘https://redacted.duckdns.org:8123/api/camera_proxy_stream/camera.ipc_cm_font_snapshot?token=<>’. A ServiceWorker intercepted the request and encountered an unexpected error. sw-modern.js:1:52029
Failed to load ‘https://redacted.duckdns.org:8123/api/camera_proxy_stream/camera.ipc_cr1_3_snapshot?token=<>’. A ServiceWorker intercepted the request and encountered an unexpected error. sw-modern.js:1:52029
Failed to load ‘https://redacted.duckdns.org:8123/api/camera_proxy_stream/camera.ipc_cr1_1_snapshot?token=<>’. A ServiceWorker intercepted the request and encountered an unexpected error. sw-modern.js:1:52029
Failed to load ‘https://redacted.duckdns.org:8123/api/camera_proxy_stream/camera.ipc_cm_yard_snapshot?token=<>’. A ServiceWorker intercepted the request and encountered an unexpected error. sw-modern.js:1:52029
TEMPLATE-ENTITY-ROW 1.4.1 IS INSTALLED <empty string> template-entity-row.js:1:44805
SLIDER-ENTITY-ROW 17.4.1 IS INSTALLED <empty string> slider-entity-row.js:1:61420
FOLD-ENTITY-ROW 2.2.0 IS INSTALLED <empty string> fold-entity-row.js:78:255
 MULTIPLE-ENTITY-ROW  4.5.1 multiple-entity-row.js:1:26787
 MINI-GRAPH-CARD  0.12.1 mini-graph-card-bundle.js:1:96068
GET
https://redacted.duckdns.org:8123/webrtc/webrtc-camera.js?v2.3.1
NS_ERROR_CORRUPTED_CONTENT

Failed to load ‘https://redacted.duckdns.org:8123/webrtc/webrtc-camera.js?v2.3.1’. A ServiceWorker intercepted the request and encountered an unexpected error. sw-modern.js:1:52029
Loading failed for the module with source “https://redacted.duckdns.org:8123/webrtc/webrtc-camera.js?v2.3.1”. cctv:1:1
Uncaught (in promise) https://redacted.duckdns.org:8123/webrtc/webrtc-camera.js?v2.3.1 74763.f6d9423fe4eab49b.js:1:240
 APEXCHARTS-CARD  v2.1.2 apexcharts-card.js:835:83771
The resource at “https://redacted.duckdns.org:8123/static/fonts/roboto/Roboto-Regular.woff2” preloaded with link preload was not used within a few seconds. Make sure all attributes of the preload tag are set correctly. cctv
The resource at “https://redacted.duckdns.org:8123/static/fonts/roboto/Roboto-Medium.woff2” preloaded with link preload was not used within a few seconds. Make sure all attributes of the preload tag are set correctly. cctv

After some digging, seem i find a way to work around.
First, in /config/.storage/lovelace_resources file, there is item point to webrtc resource "url": "/webrtc/webrtc-camera.js?v2.3.1",. Remove whole item

{
        "url": "/webrtc/webrtc-camera.js?v2.3.1",
        "type": "module",
        "id": "<long_id_i_dont_remmember>"
      },

Restart Home assistant Core, clear browser data of HA dashboard.
At this point, browser stop complain “can’t load webrtc…” but images still don’t load correctly.
I just realize that all card is picture-entity and ones load is in “auto” mode. Set the others card from “live” to “auto” and every card load fast and update instantly when image files are updated.
In the end, I’m not sure what is really causing problem but it works now!