Skip to content

fix(astro-agent-markdown): exclude yaml from dev optimizer#275

Merged
lentil32 merged 1 commit into
mainfrom
fix/landing-dev-yaml-optimizer
Jun 4, 2026
Merged

fix(astro-agent-markdown): exclude yaml from dev optimizer#275
lentil32 merged 1 commit into
mainfrom
fix/landing-dev-yaml-optimizer

Conversation

@lentil32
Copy link
Copy Markdown
Contributor

@lentil32 lentil32 commented Jun 4, 2026

One-Line Summary

Prevent Astro dev from hitting a Vite SSR optimizer reload crash after the agent Markdown middleware loads YAML.

User-Facing Changes

  • Keeps yaml out of the server-side Vite dep optimizer for @onequery/astro-agent-markdown dev middleware.
  • Avoids the dev-server failure where Vite reports a missing .vite/deps_ssr/chunk-*.js file after optimized dependencies reload.

Why This Changed

PR #274 added build-time agent Markdown bundles and attempted to pre-optimize yaml during dev SSR. In the Cloudflare dev runner, that can cause Vite to rewrite the SSR optimized dependency cache during a full reload while workerd is still resolving the previous chunk path.

The result is a local dev crash like:

The file does not exist at ".../node_modules/.vite/deps_ssr/chunk-*.js" which is in the optimize deps directory.

How It Changed

  • Switches the integration's dev-only Vite environment plugin from optimizeDeps.include to optimizeDeps.exclude for yaml.
  • Keeps the exclusion scoped to non-client environments, so client dependency optimization remains unchanged.
  • Renames the plugin from a pre-optimization-specific name to a more general dev dependency optimizer name.

Bug Fixes

  • Under astro dev with the Cloudflare adapter, loading the agent Markdown middleware could trigger a full reload after yaml optimization and leave the worker resolving a stale deps_ssr chunk. This change keeps yaml as source in server environments to avoid that optimizer invalidation path.

Extra Context / Decisions (Optional)

The generated agent Markdown bundle behavior from PR #274 is unchanged. This only adjusts dev-server dependency handling.

Verification

  • rtk git merge origin/main
  • rtk mise exec -- bun run format
  • rtk mise exec -- bunx turbo test --json --filter=@onequery/astro-agent-markdown
  • rtk mise exec -- bunx turbo typecheck --json --filter=@onequery/astro-agent-markdown
  • Pre-push hook: turbo lint with type-aware lint completed with 0 warnings and 0 errors.

Dev-server smoke validation was not completed in this pass after the workflow was redirected to merge/push/PR.

Video / Screenshot (Optional)

  • N/A

@lentil32 lentil32 enabled auto-merge (squash) June 4, 2026 08:01
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
onequery-landing 8274aeb Commit Preview URL

Branch Preview URL
Jun 04 2026, 08:01 AM

@lentil32 lentil32 merged commit 9d69c4f into main Jun 4, 2026
9 checks passed
@lentil32 lentil32 deleted the fix/landing-dev-yaml-optimizer branch June 4, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant