I’m building an app for webOS TV and hitting a blocking issue with any runtime JS resource load ( <script type="module">) once the app is packaged and running on-device/emulator.
Environment
- webOS TV app, packaged as
.ipk - Built with Vite +
@lightningjs/blits - Testing on webOS v6 emulator
Issue
when app tries to fetch .js file it fails with:
Access to script at 'file:///media/developer/apps/usr/palm/applications/com.lightning.signage/assets/index-XXXX.js' from origin 'file://com.lightning.signage-webos' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, https.
The app’s assigned origin (file://com.lightning.signage-webos) doesn’t match the literal filesystem path the resource is served from (file:///media/developer/apps/...), so every request through the module/fetch loading path is treated as cross-origin and rejected — even though the resource is in the app’s own package directory.
Is this expected/by-design behavior on webOS 6, and if so, what’s the documented pattern for Vite-based apps (module preload, code-split chunks, dynamic imports) to work around it?
I’d like a solution for the packaged app specifically — I’ve also tried a hosted (served over HTTP) version of the same build and run into separate, different loading issues there.
Any pointers to webOS docs, sample apps, or known Vite build configs that avoid this would be appreciated.