You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Problem
Two related symptoms, one root cause:
chronicle build --config examples/versioned/chronicle.yamlfails on main:versions/v1/docs/*.mdxetc.) are never rewritten to/_content/URLs, so image resolution, optimization, and cache versioning (fix: bust stale browser cache for replaced images via content-hash URLs #154) all skip them.Root cause
remark-resolve-imagesfinds the content root by searching the file path for the literal segment/content/:The
.contentmirror 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 isexamples/versioned/versions/v1/docs/page.mdx— no/content/segment — so the plugin returns early and never setsfile.data.images.Because
vite-config.tsusesvalueToExport: ['readingTime', 'images']andsource.tsimportsimagesfrom every globbed MDX module, the missing value becomes a hard build failure.This also means any project whose content directory is not literally named
contentgets no image resolution at all.Repro
bun run build:cli ./packages/chronicle/bin/chronicle.js build --config examples/versioned/chronicle.yaml # 4x MISSING_EXPORT errorsSuggested 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 /.contentmirror mapping, so pass them in as plugin options and match file paths against them. Always setfile.data.images(even when empty) so theimagesexport is guaranteed.