Skip to content

cli: app branding assets are served only from <cwd>/assets (or OS_RUNTIME_ASSETS_DIR) and silently skipped when that directory is absent — an artifact boot from any other directory draws a broken logo and favicon, with no warning #22071

Description

@objectstack-fleet

Filing gate: ① product defect with reach measured. Class (a). reach: every signed-in page of an app whose branding.logo / favicon point at /runtime/assets/*, when the server is started outside the app's project directory. Measured on @objectstack/* 17.7.0 by the repo:hotcrm seat (session_01ER8ntXZhYebyQ66aXWdjfT) during the hotcrm 17.7.0 upgrade (hotcrm PR #2008), on the maintainer's word: 「5. 品牌 logo 容易悄悄丢失 … 以上立卡」.

Who acts on it: objectstack triage routes it, likely domain:cli. ⛔ Not a claim.

Measured

hotcrm's app declares branding: { logo: '/runtime/assets/icon.svg', favicon: '/runtime/assets/icon.svg' } (src/sales/apps/crm.app.ts:61–63). The file ships in the repo at assets/icon.svg.

boot GET /runtime/assets/icon.svg console
objectstack start --artifact <dir>/objectstack.json, cwd = <dir> holding only the artifact 404 top-left logo is a broken image; no boot line mentions it
same, after copying assets/ into <dir> 200 image/svg+xml logo drawn

The maintainer noticed it in the screenshots before anyone else did (「左上角 logo是没显示出来吗」).

Code reading (origin/main 8caa131e52)

  • packages/cli/src/commands/serve.ts:3717–3723: runtimeAssetsDir = process.env.OS_RUNTIME_ASSETS_DIR?.trim() || path.resolve(process.cwd(), 'assets'). The comment beside it: "Silently skips if no assets directory exists."
  • packages/cli/src/utils/console.ts:614–615: if (!fs.existsSync(assetsDir)) return;, so the route is not mounted at all.
  • The compiled artifact carries no asset files, so an artifact copied to a host, container or other directory without the app's assets/ loses its branding.

Why it matters

  • The artifact is the deployable unit, and the docs present --artifact and OS_ARTIFACT_PATH as the deployment shape. An app's own logo then depends on a directory that travels separately and that nothing checks.
  • The failure is silent on both sides: no boot warning, and only an <img> 404 in the browser console.

A direction, for triage to rule on (⛔ not a ruling)

  • At boot, when a loaded app's branding.logo / favicon names /runtime/assets/<file> and that file is not servable, print one warning naming the app, the file, the directory searched and OS_RUNTIME_ASSETS_DIR.
  • Longer term: carry the files an app's branding references in the artifact, or a sidecar the artifact names, so the deployable unit is complete.

Not measured

A cloud or Docker deployment. The reading above is the CLI start / serve path only.

Duplicate check

Semantic issue search on objectstack, branding logo runtime assets 404 artifact deployment assets directory not packaged: 0 hits. Positive control: createRuntimeAssetsPlugin resolves in the code reading above.

Dedupe words: runtime assets 404 · branding logo broken · OS_RUNTIME_ASSETS_DIR · assets not in artifact · silently skips assets


Generated by Claude Code

Activity

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

Metadata

Metadata

Assignees

Labels

area:devpathThe road — create, dev, verify, publish/install, connect an agent, iteratebugSomething isn't workingdomain:clipriority:p2Medium: important, M3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions