-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Labels
Description
Describe the bug
After upgrading to svelte 5, I cannot use anymore custom elements that was already mounted on the page inside content scripts on my chrome extension.
The bug apparently it's because svelte 5 now rely on window.customElements, which is not available inside content scripts.
I think it is just a matter of adding a check if typeof window.customElements is undefined or not, to fallback to the previous solution that worked on v4.
Reproduction
- Create a page and add a custom element
<foo-bar> - Create a chrome extension for that page and mount a svelte component on it that uses the
<foo-bar>
Logs
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'get')
at set_custom_element_data
at update_reaction
at update_effectSystem Info
System:
OS: Windows 11 10.0.22635
CPU: (6) x64 Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz
Memory: 2.23 GB / 15.92 GB
Binaries:
Node: 22.10.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.22 - C:\Program Files\nodejs\yarn.CMD
npm: 11.0.0 - C:\Program Files\nodejs\npm.CMD
bun: 1.1.29 - ~\AppData\Roaming\npm\bun.CMD
Browsers:
Chrome: 131.0.6778.140
Edge: Chromium (127.0.2651.8)
Internet Explorer: 11.0.22621.3566Severity
blocking an upgrade