ReviewOS

stacks/stx

fix(components): resolve built-in Image with STX_SOURCE_ROOT builds

#1951
Closed glennmichael123 opened this 10 days ago ·
10 days ago

Reproduction\n\n1. Build a Stacks app with an STX source checkout supplied through STX_SOURCE_ROOT.\n2. Render a page using the documented <Image> component, for example <Image x-src="trail.image" x-alt="trail.name" width="56" height="56" />.\n3. Run the static build.\n\n### Actual behavior\n\nThe generated page contains visible fallback text instead of an image:\n\n[Error loading component: ENOENT: no such file or directory, open 'image']\n\nThe resolver searches only project component paths and the STX source component directory, then fails. The problem was observed with STX commit cc0604b4e8bd5ff22ffbeaedf2c108fdd277bbb2 in a Craft Android WebView E2E build.\n\n### Expected behavior\n\n<Image> should resolve to STX's built-in optimized-image implementation when building from a source checkout, just as it does when using the published package.\n\n### Why it matters\n\nThe error becomes user-visible text in the native bundle and makes image-heavy pages unusable. A local package build did not reproduce, which points to a source-checkout resolution path difference.

10 days ago

Fixed on main in 613cd55. Builtins are now registered into the exact registry queried by the component renderer, so a source-checkout module realm cannot make Image fall through to filesystem lookup. The new isolated-registry regression fails on the reported cc0604 revision and passes with the fix. I also verified the full WildLoop STX_SOURCE_ROOT build (26/26 pages), the local stx suite (10,489 pass, 0 fail), typecheck, lint, and all four GitHub CI jobs.

Sign in to comment on this issue.