I am experiencing an issue with my web app on a webOS 5+ LG TV. When I try to load a module script using the <script type="module">
tag, I receive a “Failed to load module script” error in the browser console. The error message reads:
I have tried setting the MIME type explicitly for the module script by adding the type="text/javascript"
attribute to the <script>
tag, but this did not resolve the issue.
The web application is working perfectly on webOS 4.x model of LG TV.
I am using Svelte framework, Vite as my build tool, and I have also tried using the Vite polyfill plugin to add support for older browsers, but this did not resolve the issue either.
I believe this issue may be related to the way LG TVs with webOS 5+ handles module scripts or the way the TV’s browser handles MIME types, but I am not sure.
Steps to reproduce:
- Load a web app on a webOS 5 LG TV.
- Attempt to load a module script using the
<script type="module">
tag. - Observe the “Failed to load module script” error in the browser console.
Minimal reproduction app: com.domain.voxe_0.0.1_all.ipk - Google Drive
Expected result:
The module script should load correctly and execute without errors.
Actual result:
The “Failed to load module script” error is displayed in the browser console.
Additional information:
Issue is appearing on the following devices:
2022 LG TV info:
- LG TV model: 43UQ75006LF
- WebOS version (SDK version): 7.2.0
- Firmware version: 03.20.26
- Browser version: Chromium 87
- Build tool: Vite 4.0.0
2020 LG TV info:
- LG TV model: 55UN73506LB
- WebOS version (SDK version): 5.4.2
- Firmware version: 04.40.70
- Browser version: Chromium 68
- Build tool: Vite 4.0.0
Any help or guidance on resolving this issue would be greatly appreciated.
Thank you.