DX: "add emdash to existing Astro project" path has 3 unstated requirements that produce silent failures #1761
khoinguyenpham04
announced in
Roadmap
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
This Roadmap discussion mirrors #962: DX: "add emdash to existing Astro project" path has 3 unstated requirements that produce silent failures.
Use this discussion to upvote the roadmap item and discuss priority, use cases, and product feedback. Keep implementation tracking, reproduction details, and PR-specific feedback on the source issue.
roadmap/1.0,roadmap/migration-onboardingOriginal Issue
Description
The "add emdash to an existing Astro project" path has at least three requirements that aren't surfaced by the docs or the install flow. Each one produces a silent failure (build OK, runtime crash or non-hydrating UI) which is hard to diagnose for someone vibe-coding a site, especially when an AI agent is driving the install.
I hit all three back-to-back today while wiring emdash 0.10.0 into an existing Astro project (Astro 4 -> 6 upgrade) deployed to Cloudflare Workers. None of these blocked
npm create emdash@latest, presumably because the starter template ships them pre-wired.Three friction points
1.
experimental.cache.provideris required, undocumented/_emdash/api/content/posts/<id>/publishand.../unpublishdestructurecachefrom the route context and callcache.invalidate({ tags: [...] })/cache.enableddirectly. If the host project hasn't enabledexperimental.cachewith a provider,cacheisundefinedat runtime and every publish/unpublish returns HTTP 500 withTypeError: Cannot read properties of undefined (reading 'enabled').Fix that worked for me:
Suggested upstream fix: ship a no-op cache fallback in the route handler (
if (cache?.enabled) await cache.invalidate(...)), or call this requirement out in the "Adding to an existing project" docs.2.
@astrojs/reactmust be registered in hostastro.configemdash declares
@astrojs/reactas a peer dependency, but installing it isn't enough. The admin React shell builds successfully withoutreact()in the host'sintegrations: [...], and the page even returns 200 with the boot loader markup. The bundle just never hydrates, so the admin sits forever on "Loading EmDash...".Suggested upstream fix: emit a clear build-time error or postinstall warning if the host config lacks
@astrojs/react. Or have the emdash integration assert it's been registered.3. Tiptap collaboration peer deps not declared
After install, the build fails with a chain of
Could not resolve "@tiptap/extension-collaboration","@tiptap/y-tiptap","yjs","y-protocols". They are pulled in transitively from@tiptap/extension-drag-handlebut not as direct deps that npm/pnpm will guarantee. On a vibe-coded install this manifests as a wall of esbuild errors.Fix that worked:
Suggested upstream fix: pin these as direct deps of
@emdash-cms/adminor list them in the docs.4. No graft guide
Most of the friction would evaporate if there were a docs page parallel to "Getting Started" titled something like "Add emdash to an existing Astro project" that walked through:
experimental.cacherequirementreact(),cloudflare()for CF)npm installwrangler.jsoncfor D1 + R2 + KVwrangler.json)Steps to reproduce
@astrojs/cloudflare.npm install emdash @astrojs/cloudflare @emdash-cms/cloudflare --legacy-peer-deps.astro.config.mjsper the "Adding to an existing project" instructions in the docs./_emdash/admin. Page sits on "Loading EmDash..." because@astrojs/reactisn't registered.react(). Rebuild + redeploy. Admin loads.cache.enabledTypeError. Addexperimental.cache.provider: memoryCache(). Rebuild + redeploy. Publish works.Expected
The official docs path for "add to existing site" should land you in a working state, or at least surface a single actionable error per missing piece, not a silent 500 on the publish flow.
Actual
Three silent failures in sequence, each requiring server-side log access and source-of-
@emdash-cms/adminreading to diagnose.Environment
All reactions