Skip to content

[Bug report] Static builds can't be served under a subpath: baked URLs stay root-absolute #493

Closed

Description

@0froq

Summary

buildHub bakes absolute URLs for frame bases, dock entries, page scripts, and SPA asset references. When the built tree is served below the domain root, those URLs still point at /__..., so every panel and asset request 404s.

The deploy-root sibling layout from #355 works when the output is served at /.

Reproduction

await buildHub({
  outDir: 'dist/__devtools',
  base: '/ci-build-123456/__devtools/',
  async configure(ctx) {
    ctx.views.hostStatic('/__panel/', 'panel-dist')
    ctx.docks.register({
      id: 'panel',
      title: 'Panel',
      icon: '/__panel/icon.svg',
      type: 'iframe',
      url: '/__panel/',
    })
  },
})

Serve dist/ at /ci-build-123456/, for example with a static server mounted on that path. This is the layout Vite DevTools uses, where the hub sits at /__devtools/ and each integration SPA is a sibling.

Expected

  • /ci-build-123456/__panel/ loads, and its HTML references /ci-build-123456/__panel/....
  • Frame bases in __index.json and the dock snapshot in the RPC dump carry the same prefix.
  • The on-disk layout stays dist/__panel/ and dist/__devtools/.

Actual

  • Dock entries and frame bases bake /__panel/, so the iframe 404s.
  • A prebuilt SPA with root-absolute assets (/__panel/_nuxt/...) 404s for every asset even after the dock URL is fixed.
  • The RPC dump and __index.json keep the root-absolute strings.

A real-world report with the same root cause: vitejs/devtools#583.

Environment

devframe 1.3.5, Node 24, macOS.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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