Images in versioned content are never resolved; versioned example build fails with missing 'images' export
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript, vite
- Domain
- build-system, tooling
Research direction
Start with remark-resolve-images and the MDX pipeline setup in vite-config.ts, then inspect source.ts where images is imported from globbed modules. Reproduce with the versioned chronicle.yaml build command and trace the .content mirror paths. Done means versioned builds succeed, images exports are always present, and versioned image paths are resolved.
Written by the indexing model from the issue text.
Description
Problem
Two related symptoms, one root cause:
chronicle build --config examples/versioned/chronicle.yamlfails on main:
[MISSING_EXPORT] Error: "images" is not exported by "examples/versioned/versions/v1/dev/index.mdx"
- Images referenced from versioned content (
versions/v1/docs/*.mdxetc.) are never rewritten to/_content/URLs, so image resolution, optimization, and cache versioning (#154) all skip them.
Root cause
remark-resolve-images finds the content root by searching the file path for the literal segment /content/:
const contentIdx = filePath.lastIndexOf('/content/')
if (contentIdx === -1) return
The .content mirror symlinks individual files, and Vite resolves those symlinks to their real paths. For latest content the real path happens to contain /content/ (e.g. examples/basic/content/docs/page.mdx), so it works. For versioned content the real path is examples/versioned/versions/v1/docs/page.mdx — no /content/ segment — so the plugin returns early and never sets file.data.images.
Because vite-config.ts uses valueToExport: ['readingTime', 'images'] and source.ts imports images from every globbed MDX module, the missing value becomes a hard build failure.
This also means any project whose content directory is not literally named content gets no image resolution at all.
Repro
bun run build:cli
./packages/chronicle/bin/chronicle.js build --config examples/versioned/chronicle.yaml
# 4x MISSING_EXPORT errors
Suggested fix
Stop inferring the content root from the path string. The plugin (or the MDX pipeline setup in vite-config.ts) already knows the real content roots from the chronicle config / .content mirror mapping, so pass them in as plugin options and match file paths against them. Always set file.data.images (even when empty) so the images export is guaranteed.
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 1
- Avg merge
- 12h 29m
- Merged PRs (30d)
- 12
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from raystack/chronicle
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
All issues in raystack/chronicle
Similar issues
-
Browser Waiting for: Product Owner
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
getsentry/sentry-javascript#24577 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agilepathway/label-checker#640 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
copse-dev/agent-pane#2953 ·
-
agentic-workflows
Difficulty 1/5 Under an hour Newbie friendliness 85/100
githubnext/rig#534 ·
-
automation missing-model model-sync provider:pioneer
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
anomalyco/models.dev#7701 ·