withastro
astro
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
fix(server): skip dev server plugin setup in Vitest to prevent wrapDynamicImport crash (#16275)
triagebot/fix-16275
1 hour ago
Fix route generator throwing on a dynamic param value of 0 getParameter() used truthy checks (!params[x], || '') instead of checking for undefined, so a param legitimately set to 0 (e.g. a zero-indexed category id) either threw TypeError: Missing parameter or got silently dropped from the path. Reachable through the public paginate() API: paginate(posts, { params: { categoryId: 0 } }) would crash. Added tests covering both the spread and dynamic-segment branches.
chatman-media:fix/route-generator-zero-param
8 hours ago
fix: prevent trailing slash on dynamic file endpoints during build (#17241)\n\nOverride trailingSlash to 'never' in stringifyParams for endpoint routes\nwith file extensions, matching the route pattern generated by\ntrailingSlashForPath in create-manifest.ts. This fixes a regression from\n#17224 where dynamic file endpoints (e.g. [name].json.ts) with\ntrailingSlash: 'always' would fail to build with TypeError: Missing\nparameter."
triagebot/fix-17241
9 hours ago
fix(cloudflare): skip workerd environment and dev server under Vitest\n\nWhen running under Vitest (detected via process.env.VITEST), the\n@cloudflare/vite-plugin and its workerd-based SSR environment are\nfundamentally incompatible with Vitest's module runner due to multiple\nlayered conflicts:\n\n1. Vitest injects Node.js builtins into resolve.external which the\n Cloudflare plugin validates and rejects\n2. Vitest disables the dep optimizer, causing CJS packages to be served\n as raw CJS to workerd's module runner (which lacks the exports global)\n3. Vitest's mocker plugin transforms dynamic import() calls in Astro's\n server code, causing wrapDynamicImport errors when the mocker runtime\n is not initialized in the SSR module runner context\n\nThe fix:\n- Skips @cloudflare/vite-plugin entirely under Vitest, letting the SSR\n environment fall back to Vite's default Node.js-based DevEnvironment\n- Skips workerd-specific optimizeDeps configuration under Vitest\n- Skips Astro's dev server configureServer hook under Vitest (the dev\n server is not needed for running tests)\n\nThis follows the same pattern as isTypeGenPhase which already skips the\nworkerd setup during type generation.\n\nFixes #15878
triagebot/fix-15878
10 hours ago
Fix inline `<style>` blocks ignoring `vite.build.target` when `cssMinify` is false (#17226) * fix(build): apply CSS target lowering when cssMinify is disabled (#17225) When `vite.build.minify: false` is set, Astro couples `cssMinify` to `minify`, forcing `cssMinify: false`. Vite's CSS target lowering only runs inside `finalizeCss` → `minifyCSS`, which is gated on `cssMinify` being truthy. This means no CSS gets target-lowered — neither imported stylesheets nor inline `.astro` `<style>` blocks. Add a new Vite plugin (`astro:css-target-lowering`) that applies lightningcss target lowering with `minify: false` to all CSS assets in `generateBundle` when `cssMinify` is falsy and a CSS target is configured. This decouples target lowering from minification, ensuring CSS respects the configured `build.target`/`cssTarget` regardless of minification settings. The plugin: - Converts esbuild/Vite target strings to lightningcss format - Resolves lightningcss from Vite's dependencies (not a direct dep) - Runs in generateBundle before inline-stylesheets processing - Only activates when cssMinify is disabled and cssTarget is set * fix(ci): update pnpm-lock.yaml for new test fixture --------- Co-authored-by: Matthew Phillips <matthew@matthewphillips.info>
main
12 hours ago
fix(ci): update pnpm-lock.yaml for new test fixture
triagebot/fix-17225
12 hours ago
Merge branch 'main' into dev-restart-reoptimize-deps
dev-restart-reoptimize-deps
13 hours ago
Fix spurious dependency re-optimization on dev server restart
dev-restart-reoptimize-deps
13 hours ago
Latest Branches
CodSpeed Performance Gauge
0%
Skip dev server setup in `configureServer` when running inside Vitest
#17248
6 days ago
2b7415e
triagebot/fix-16275
CodSpeed Performance Gauge
0%
Fix route generator throwing on a dynamic param value of 0
#17247
8 hours ago
e630160
chatman-media:fix/route-generator-zero-param
CodSpeed Performance Gauge
0%
Fix build failure for dynamic file endpoints with trailingSlash "always"
#17246
13 hours ago
6f92832
triagebot/fix-17241
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs