Skip to content

Starter template build is not self-contained: base set to /<device>/ breaks asset paths when serving dist/<device> as web root #1

Description

@Govrdhn

Summary

The device config plugin derives the Vite base from the output folder name, so a
build emits index.html with absolute asset URLs like /common/assets/.... When you
serve the generated dist/<device>/ directory as the web root (the natural thing to do,
and how a packaged TV app loads), those /common/assets/... paths don't exist at that
root — the assets are actually at /assets/... — so every script/asset 404s and the app
fails to load.

Environment

  • Starter template (default config)
  • Vite 6.x, @vitejs/plugin-legacy
  • Reproduced with no TARGET_DEVICE set (defaults to common) and with TARGET_DEVICE=tizen

Steps to reproduce

  1. npm install
  2. npm run build
  3. Serve the build as its own root, e.g. cd dist/common && npx serve .
    (or sideload dist/tizen on a device, where the app loads from a file://-style root)
  4. Open the app.

Expected

The contents of dist/<device>/ are self-contained and load correctly when that folder
is the web root.

Actual

dist/<device>/index.html references assets with an absolute, folder-prefixed path:

<script type="module" crossorigin src="/common/assets/index-XXXX.js"></script>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions