Client `optimizeDeps.include` lists `lowlight`/`highlight.js` as bare ids, so the #2916 fix does not apply to pnpm consumers
Environment: emdash 0.38.0, @emdash-cms/admin 0.38.0, Astro 6.4.8, @astrojs/cloudflare 13.7.0, Vite 6.4.2, pnpm workspace.
What happens. src/astro/integration/vite-config.ts:608-616 (published: dist/astro/index.mjs:1980-1992) adds "lowlight", "highlight.js" and "highlight.js/lib/core" to the client optimizeDeps.include. Vite resolves those ids from the Vite root — the consumer's app — but they are dependencies of emdash and @emdash-cms/admin, not of the consumer. Under pnpm's non-hoisted layout they do not resolve, so every optimizer run prints:
[vite] Failed to resolve dependency: lowlight, present in client 'optimizeDeps.include'
[vite] Failed to resolve dependency: highlight.js, present in client 'optimizeDeps.include'
[vite] Failed to resolve dependency: highlight.js/lib/core, present in client 'optimizeDeps.include'The entries are then dropped. That matters beyond the noise: #2921 added them to guarantee CJS interop for InlinePortableTextEditor, which lives in emdash — not in @emdash-cms/admin, the one include id that does resolve. For pnpm consumers the guard is inert and the chain is back to runtime discovery, i.e. the exact condition #2916 described. npm/yarn users hoist these packages, resolve them, and see nothing, which is why this has stayed invisible.
Repro. pnpm create astro@latest, add emdash, run astro check or astro dev. Expected: no warnings. Actual: the three lines above.
Fix. Use the nested form the same file already uses for SSR ("emdash > zod", :580): "emdash > lowlight", "emdash > highlight.js", "emdash > highlight.js/lib/core".
Workaround we use. None available — a consumer-side optimizeDeps.exclude does not reach the client environment. We documented the warnings in our CI runbook.
Source: emdash-cms/emdash