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
#15888925252e Thanks @matthewp! - Fixes a bug where dependencies imported by prerender-only server:defer islands could remain as bare imports in server output, causing module resolution failures in preview and Cloudflare Workers.
#15875c43ef8a Thanks @matthewp! - Include workerd response details in Cloudflare prerenderer errors to make getStaticPaths() failures easier to diagnose.
#15815d1872ee Thanks @matthewp! - Prebundle additional Astro runtime dependencies for Cloudflare development server, speeding up initial start time and preventing required restarts.
#158723b47b89 Thanks @Princesseuh! - Fixes images not working in dev mode when using the cloudflare option
By default, Cloudflare uses its workerd runtime for prerendering static pages. Set prerenderEnvironment to 'node' to use Astro's built-in Node.js prerender environment instead, giving prerendered pages access to the full Node.js ecosystem during both build and dev. This is useful when your prerendered pages depend on Node.js-specific APIs or NPM packages that aren't compatible with workerd.
#1584550fcc8b Thanks @aqiray! - fix: show actionable error when running astro preview without prior build
#15794d1ac58e Thanks @OliverSpeir! - Fixes image serving in passthrough mode by using the Cloudflare ASSETS binding instead of generic fetch, which does not work in Workers for local assets
#15850660da74 Thanks @tristanbes! - fix(cloudflare): forward configPath and other PluginConfig options to the Cloudflare Vite Plugin
Options like configPath, inspectorPort, persistState, remoteBindings, and auxiliaryWorkers were accepted by the type system but never forwarded to cfVitePlugin(), making them silently ignored.
Also fixes addWatchFile for configPath which resolved the path relative to the adapter's node_modules directory instead of the project root.
#1583295e12a2 Thanks @Princesseuh! - Fixes return; syntax not working in the frontmatter correctly in certain contexts
#15803e42b015 Thanks @merlinnot! - Fixes the Cloudflare adapter adding a SESSION KV binding even when sessions are explicitly configured to use a different driver, such as unstorage/drivers/null.
#14306141c4a2 Thanks @ematipico! - Changes the API for creating a custom entrypoint, replacing the createExports() function with a direct export pattern.
What should I do?
If you're using a custom entryPoint in your Cloudflare adapter config, update your existing worker file that uses createExports() to reflect the new, simplified pattern:
my-entry.ts
importtype{SSRManifest}from'astro';import{App}from'astro/app';import{handle}from'@​astrojs/cloudflare/handler';import{DurableObject}from'cloudflare:workers';classMyDurableObjectextendsDurableObject<Env>{constructor(ctx: DurableObjectState,env: Env){super(ctx,env);}}exportfunctioncreateExports(manifest: SSRManifest){constapp=newApp(manifest);return{default: {asyncfetch(request,env,ctx){awaitenv.MY_QUEUE.send('log');returnhandle(manifest,app,request,env,ctx);},asyncqueue(batch,_env){letmessages=JSON.stringify(batch.messages);console.log(`consumed from our queue: ${messages}`);},}satisfiesExportedHandler<Env>,MyDurableObject: MyDurableObject,};}
To create the same custom entrypoint using the updated API, export the following function instead:
my-entry.ts
import{handle}from'@​astrojs/cloudflare/utils/handler';exportdefault{asyncfetch(request,env,ctx){awaitenv.MY_QUEUE.send("log");returnhandle(manifest,app,request,env,ctx);},asyncqueue(batch,_env){letmessages=JSON.stringify(batch.messages);console.log(`consumed from our queue: ${messages}`);}}satisfiesExportedHandler<Env>,
The manifest is now created internally by the adapter.
#15435957b9fe Thanks @rururux! - Changes the default image service from compile to cloudflare-binding. Image services options that resulted in broken images in development due to Node JS incompatiblities have now been updated to use the noop passthrough image service in dev mode. - (Cloudflare v13 and Astro6 upgrade guidance)
#1540041eb284 Thanks @florian-lefebvre! - Removes the workerEntryPoint option, which wasn't used anymore. Set the main field of your wrangler config instead
astro dev now runs your Cloudflare application using Cloudflare's workerd runtime instead of Node.js. This means your development environment is now a near-exact replica of your production environment—the same JavaScript engine, the same APIs, the same behavior. You'll catch issues during development that would have only appeared in production, and features like Durable Objects, Workers Analytics Engine, and R2 bindings work exactly as they do on Cloudflare's platform.
New runtime
Previously, Astro.locals.runtime provided access to Cloudflare-specific APIs. These APIs have now moved to align with Cloudflare's native patterns.
What should I do?
Update occurrences of Astro.locals.runtime:
Astro.locals.runtime.env → Import env from cloudflare:workers
Astro.locals.runtime.cf → Access via Astro.request.cf
Astro.locals.runtime.caches → Use the global caches object
Astro.locals.runtime (for ExecutionContext) → Use Astro.locals.cfContext
Here's an example showing how to update your code:
Before:
---const { env, cf, caches, ctx } =Astro.locals.runtime;const value =awaitenv.MY_KV.get('key');const country =cf.country;awaitcaches.default.put(request, response);ctx.waitUntil(promise);---
<h1>Country: {country}</h1>
After:
---import { env } from'cloudflare:workers';const value =awaitenv.MY_KV.get('key');const country =Astro.request.cf.country;awaitcaches.default.put(request, response);Astro.locals.cfContext.waitUntil(promise);---
<h1>Country: {country}</h1>
The cloudflareModules option has been removed because it is no longer necessary. Cloudflare natively supports importing .sql, .wasm, and other module types.
What should I do?
Remove the cloudflareModules option from your Cloudflare adapter configuration if you were using it:
The Astro Cloudflare adapter now only supports deployment to Cloudflare Workers by default in order to comply with Cloudflare's recommendations for new projects. If you are currently deploying to Cloudflare Pages, consider migrating to Workers by following the Cloudflare guide for an optimal experience and full feature support.
Minor Changes
#15435957b9fe Thanks @rururux! - Adds support for configuring the image service as an object with separate build and runtime options
It is now possible to set both a build-time and runtime service independently. Currently, 'compile' is the only available build time option. The supported runtime options are 'passthrough' (default) and 'cloudflare-binding':
#15077a164c77 Thanks @matthewp! - Adds support for prerendering pages using the workerd runtime.
The Cloudflare adapter now uses the new setPrerenderer() API to prerender pages via HTTP requests to a local preview server running workerd, instead of using Node.js. This ensures prerendered pages are built using the same runtime that serves them in production.
Developers can now use astro preview to test their Cloudflare Workers application locally before deploying. The preview runs using Cloudflare's workerd runtime, giving you a staging environment that matches production exactly—including support for KV namespaces, environment variables, and other Cloudflare-specific features.
#150378641805 Thanks @matthewp! - The Wrangler configuration file is now optional. If you don't have custom Cloudflare bindings (KV, D1, Durable Objects, etc.), Astro will automatically generate a default configuration for you.
What should I do?
If your wrangler.jsonc only contains basic configuration like this:
Specifying the session driver as a string has been deprecated, but will continue to work until this feature is removed completely in a future major version. The object shape is the current recommended and documented way to configure a session driver.
#15080f67b738 Thanks @gameroman! - Updates wrangler dependency to be a peerDependency over a dependency
#150396cc96e7 Thanks @matthewp! - Fixes static content deployment by moving it to another folder, so Wrangler can tell the static and worker content apart
#15452e1aa3f3 Thanks @matthewp! - Fixes server-side dependencies not being discovered ahead of time during development
Previously, imports in .astro file frontmatter were not scanned by Vite's dependency optimizer, causing a "new dependencies optimized" message and page reload when the dependency was first encountered. Astro is now able to scan these dependencies ahead of time.
#153915d996cc Thanks @florian-lefebvre! - Fixes types of the handle() function exported from /handler, that could be incompatible with types generated by wrangler types
#15696a9fd221 Thanks @Princesseuh! - Fixes duplicate logging showing up in some cases when prerendering pages
#153094b9c8b8 Thanks @ematipico! - Update the underneath @cloudflare/workers-types library to address a warning emitted by the package manager during the installation.
#150794463a55 Thanks @ascorbic! - Fixes auto-provisioning of default bindings (SESSION KV, IMAGES, and ASSETS). Default bindings are now correctly applied whether or not you have a wrangler.json file.
Previously, these bindings were only added when no wrangler config file existed. Now they are added in both cases, unless you've already defined them yourself.
#1569466449c9 Thanks @matthewp! - Fixes deployment of static sites with the Cloudflare adapter
Fixes an issue with detecting and building fully static sites that caused deployment errors when using output: 'static' with the Cloudflare adapter
#1556530cd6db Thanks @ematipico! - Fixes an issue where the use of the Code component would result in an unexpected error.
#1512106261e0 Thanks @ematipico! - Fixes a bug where the Astro, with the Cloudflare integration, couldn't correctly serve certain routes in the development server.
#157784ebc1e3 Thanks @ematipico! - Fixes an issue where the computed clientAddress was incorrect in cases of a Request header with multiple values. The clientAddress is now also validated to contain only characters valid in IP addresses, rejecting injection payloads.
This CommonJS dependency could sometimes cause errors because Astro is ESM-only. It is now replaced with a built-in ESM-friendly implementation.
#15075ee2c260 Thanks @matthewp! - Adds deprecation errors for Astro.locals.runtime properties to help migrate from Astro v5 to v6
When accessing the removed Astro.locals.runtime properties on Cloudflare, developers now receive clear error messages explaining the migration path:
Astro.locals.runtime.env → Use import { env } from "cloudflare:workers"
Astro.locals.runtime.cf → Use Astro.request.cf
Astro.locals.runtime.caches → Use the global caches object
Astro.locals.runtime.ctx → Use Astro.locals.cfContext
#153369cce92e Thanks @ascorbic! - Fixes a dev server issue where framework components from linked packages would fail to load with a 504 error.
This could occur when using client:only or other client directives with components from monorepo packages (linked via file: or workspace protocol). The first request would trigger Vite's dependency optimizer mid-request, causing concurrent client module requests to fail.
#15255a66783a Thanks @florian-lefebvre! - Fixes a case where the types of handle() could mismatch with the ones from the user's project. They now rely on globals, that can be obtained by running wrangler types
#1504531074fc Thanks @ematipico! - Fixes an issue where using the Vue integration with the Cloudflare adapter resulted in some runtime errors.
#15386a0234a3 Thanks @OliverSpeir! - Updates astro add cloudflare to use the latest valid compatibility_date in the wrangler config, if available
#15432e2ad69e Thanks @OliverSpeir! - Removes unnecessary warning about sharp from being printed at start of dev server and build
#15588425ea16 Thanks @rururux! - Fixes an issue where esbuild would throw a "Top-level return cannot be used inside an ECMAScript module" error during dependency scanning in certain environments.
#1545050c9129 Thanks @florian-lefebvre! - Fixes a case where build.serverEntry would not be respected when using the new Adapter API
#15030b5aa52b Thanks @ematipico! - Fixed an issue where the feature experimental.chromeDevtoolsWorkspace wasn't supported by the new version of the adapter.
#15648802426b Thanks @rururux! - Restore and fix <Code /> component functionality on Cloudflare Workers.
#15478ee519e5 Thanks @matthewp! - Fixes fully static sites to not output server-side worker code. When all routes are prerendered, the _worker.js directory is now removed from the build output.
#152696f82aae Thanks @ematipico! - Fixes a regression where build.serverEntry stopped working as expected.
#1579805771cf Thanks @rururux! - Fixes a regression where using the adapter would throw an error when using an integration that uses JSX.
#15053674b63f Thanks @matthewp! - Excludes astro:* and virtual:astro:* from client optimizeDeps in core. Needed for prefetch users since virtual modules are now in the dependency graph.
#154955b99e90 Thanks @leekeh! - Refactors to use middlewareMode adapter feature (set to classic)
#1526411efb05 Thanks @florian-lefebvre! - Lower the Node version requirement to allow running on Stackblitz until it supports v22
#157004e7f3e8 Thanks @ocavue! - Improves how React components are identified when setting the include and/or exclude options in projects where multiple JSX frameworks are used together
The getContainerRenderer() function is exported by Astro framework integrations to simplify the process of rendering framework components when using the experimental Container API inside a Vite or Vitest environment. This update adds the client hydration entrypoint to the returned object, enabling client-side interactivity for components rendered using this function. Previously this required users to manually call container.addClientRenderer() with the appropriate client renderer entrypoint.
This example calls a like action that accepts a postId and returns the number of likes. Pass this action to the withState() function to apply progressive enhancement info, and apply to useActionState() to track the result:
You can also access the state stored by useActionState() from your action handler. Call getActionState() with the API context, and optionally apply a type to the result:
import { defineAction } from 'astro:actions';
import { z } from 'astro:schema';
import { getActionState } from '@​astrojs/react/actions';
export const server = {
like: defineAction({
input: z.object({
postId: z.string(),
}),
handler: async ({ postId }, ctx) => {
const currentLikes = getActionState<number>(ctx);
// write to database
return currentLikes + 1;
},
}),
};
If you were previously using this experimental feature, you will need to update your code to use the new stable exports:
// src/components/Form.jsx
import { actions } from 'astro:actions';
-import { experimental_withState } from '@​astrojs/react/actions';+import { withState } from '@​astrojs/react/actions';
import { useActionState } from "react";
// src/actions/index.ts
import { defineAction, type SafeResult } from 'astro:actions';
import { z } from 'astro:schema';
-import { experimental_getActionState } from '@​astrojs/react/actions';+import { getActionState } from '@​astrojs/react/actions';
#159652dca307 Thanks @matthewp! - Fixes client hydration for components imported through Node.js subpath imports (package.json#imports, e.g. #components/*), for example when using the Cloudflare adapter in development.
#157706102ca2 Thanks @jpc-ae! - Updates the create astro welcome message to highlight the graceful dev/preview server quit command rather than the kill process shortcut
#159537eddf22 Thanks @Desel72! - fix(hmr): eagerly recompile on style-only change to prevent stale slots render
#159165201ed4 Thanks @trueberryless! - Fixes InferLoaderSchema type inference for content collections defined with a loader that includes a schema
#15864d3c7de9 Thanks @florian-lefebvre! - Removes temporary support for Node >=20.19.1 because Stackblitz now uses Node 22 by default
#15944a5e1acd Thanks @fkatsuhiro! - Fixes SSR dynamic routes with .html extension (e.g. [slug].html.astro) not working
#15937d236245 Thanks @ematipico! - Fixes an issue where HMR didn't correctly work on Windows when adding/changing/deleting routes in pages/.
#1593198dfb61 Thanks @Strernd! - Fix skew protection query params not being applied to island hydration component-url and renderer-url, and ensure query params are appended safely for asset URLs with existing search/hash parts.
#15891b889231 Thanks @matthewp! - Fix dev routing for server:defer islands when adapters opt into handling prerendered routes in Astro core. Server island requests are now treated as prerender-handler eligible so prerendered pages using prerenderEnvironment: 'node' can load island content without 400 errors.
#15890765a887 Thanks @matthewp! - Fixes astro:actions validation to check resolved routes, so projects using default static output with at least one prerender = false page or endpoint no longer fail during startup.
#15884dcd2c8e Thanks @matthewp! - Avoid a MaxListenersExceededWarning during astro dev startup by increasing the shared Vite watcher listener limit when attaching content server listeners.
#1590423d5244 Thanks @jlukic! - Emit the before-hydration script chunk for the client Vite environment. The chunk was only emitted for prerender and ssr environments, causing a 404 when browsers tried to load it. This broke hydration for any integration using injectScript('before-hydration', ...), including Lit SSR.
#15933325901e Thanks @ematipico! - Fixes an issue where <style> tags inside SVG components weren't correctly tracked when enabling CSP.
#15875c43ef8a Thanks @matthewp! - Ensure custom prerenderers are always torn down during build, even when getStaticPaths() throws.
#158871861fed Thanks @ematipico! - Fixes an issue where the build incorrectly leaked server entrypoint into the client environment, causing adapters to emit warnings during the build.
#15888925252e Thanks @matthewp! - Fix a bug where server:defer could fail at runtime in prerendered pages for some adapters (including Cloudflare), causing errors like serverIslandMap?.get is not a function.
#1590107c1002 Thanks @delucis! - Fixes JSON schema generation for content collection schemas that have differences between their input and output shapes.
#15882759f946 Thanks @matthewp! - Fix Astro.url.pathname for the root page when using build.format: "file" so it resolves to /index.html instead of /.html during builds.
Next steps: Take a moment to review the security alert above. Review
the linked package source code to understand the potential risk. Ensure the
package is not malicious before proceeding. If you're unsure how to proceed,
reach out to your security team or ask the Socket team for help at
support@socket.dev.
Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.
Mark the package as acceptable risk. To ignore this alert only
in this pull request, reply with the comment
@SocketSecurity ignore npm/miniflare@4.20260317.2. You can
also ignore all packages with @SocketSecurity ignore-all.
To ignore an alert for all future pull requests, use Socket's Dashboard to
change the triage state of this alert.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dependenciesPull requests that update a dependency
0 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^12.6.4→^13.0.0^4.3.0→^5.0.0^5.13.2→^6.0.0Release Notes
withastro/astro (@astrojs/cloudflare)
v13.1.2Compare Source
Patch Changes
#15888
925252eThanks @matthewp! - Fixes a bug where dependencies imported by prerender-onlyserver:deferislands could remain as bare imports in server output, causing module resolution failures in preview and Cloudflare Workers.#15934
6f8f0bcThanks @ematipico! - Updates the AstropeerDependencies#astroto be6.0.0.#15875
c43ef8aThanks @matthewp! - Include workerd response details in Cloudflare prerenderer errors to makegetStaticPaths()failures easier to diagnose.Updated dependencies []:
v13.1.1Compare Source
Patch Changes
#15815
d1872eeThanks @matthewp! - Prebundle additional Astro runtime dependencies for Cloudflare development server, speeding up initial start time and preventing required restarts.#15872
3b47b89Thanks @Princesseuh! - Fixes images not working in dev mode when using thecloudflareoptionUpdated dependencies []:
v13.1.0Compare Source
Minor Changes
#15711
b2bd27bThanks @OliverSpeir! - Adds aprerenderEnvironmentoption to the Cloudflare adapter.By default, Cloudflare uses its workerd runtime for prerendering static pages. Set
prerenderEnvironmentto'node'to use Astro's built-in Node.js prerender environment instead, giving prerendered pages access to the full Node.js ecosystem during both build and dev. This is useful when your prerendered pages depend on Node.js-specific APIs or NPM packages that aren't compatible with workerd.Patch Changes
#15845
50fcc8bThanks @aqiray! - fix: show actionable error when running astro preview without prior build#15794
d1ac58eThanks @OliverSpeir! - Fixes image serving inpassthroughmode by using the CloudflareASSETSbinding instead of generic fetch, which does not work in Workers for local assets#15850
660da74Thanks @tristanbes! - fix(cloudflare): forwardconfigPathand otherPluginConfigoptions to the Cloudflare Vite PluginOptions like
configPath,inspectorPort,persistState,remoteBindings, andauxiliaryWorkerswere accepted by the type system but never forwarded tocfVitePlugin(), making them silently ignored.Also fixes
addWatchFileforconfigPathwhich resolved the path relative to the adapter'snode_modulesdirectory instead of the project root.#15843
fcd237dThanks @Calvin-LL! - fix cloudflare image transform ignoring quality parameterUpdated dependencies []:
v13.0.2Patch Changes
#15832
95e12a2Thanks @Princesseuh! - Fixesreturn;syntax not working in the frontmatter correctly in certain contexts#15803
e42b015Thanks @merlinnot! - Fixes the Cloudflare adapter adding aSESSIONKV binding even when sessions are explicitly configured to use a different driver, such asunstorage/drivers/null.Updated dependencies []:
v13.0.1Patch Changes
e20474b]:v13.0.0Compare Source
Major Changes
141c4a2Thanks @ematipico! - Changes the API for creating a customentrypoint, replacing thecreateExports()function with a direct export pattern.What should I do?
If you're using a custom
entryPointin your Cloudflare adapter config, update your existing worker file that usescreateExports()to reflect the new, simplified pattern:my-entry.ts
To create the same custom
entrypointusing the updated API, export the following function instead:my-entry.ts
The manifest is now created internally by the adapter.
#15435
957b9feThanks @rururux! - Changes the default image service fromcompiletocloudflare-binding. Image services options that resulted in broken images in development due to Node JS incompatiblities have now been updated to use the noop passthrough image service in dev mode. - (Cloudflare v13 and Astro6 upgrade guidance)#15400
41eb284Thanks @florian-lefebvre! - Removes theworkerEntryPointoption, which wasn't used anymore. Set themainfield of your wrangler config insteadSee how to migrate
#14306
141c4a2Thanks @ematipico! - Development server now runs in workerdastro devnow runs your Cloudflare application using Cloudflare's workerd runtime instead of Node.js. This means your development environment is now a near-exact replica of your production environment—the same JavaScript engine, the same APIs, the same behavior. You'll catch issues during development that would have only appeared in production, and features like Durable Objects, Workers Analytics Engine, and R2 bindings work exactly as they do on Cloudflare's platform.New runtime
Previously,
Astro.locals.runtimeprovided access to Cloudflare-specific APIs. These APIs have now moved to align with Cloudflare's native patterns.What should I do?
Update occurrences of
Astro.locals.runtime:Astro.locals.runtime.env→ Importenvfromcloudflare:workersAstro.locals.runtime.cf→ Access viaAstro.request.cfAstro.locals.runtime.caches→ Use the globalcachesobjectAstro.locals.runtime(forExecutionContext) → UseAstro.locals.cfContextHere's an example showing how to update your code:
Before:
After:
#15345
840fbf9Thanks @matthewp! - Removes thecloudflareModulesadapter optionThe
cloudflareModulesoption has been removed because it is no longer necessary. Cloudflare natively supports importing.sql,.wasm, and other module types.What should I do?
Remove the
cloudflareModulesoption from your Cloudflare adapter configuration if you were using it:import cloudflare from '@​astrojs/cloudflare'; export default defineConfig({ adapter: cloudflare({ - cloudflareModules: true }) });#14445
ecb0b98Thanks @florian-lefebvre! - Astro v6.0 upgrades to Vite v7.0 as the development server and production bundler - (v6 upgrade guidance)#15037
8641805Thanks @matthewp! - Updates the Wrangler entrypointPreviously, the
mainfield inwrangler.jsoncpointed to the built output, since Wrangler only ran in production after the build completed:{ "main": "dist/_worker.js/index.js", }Now that Wrangler runs in both development (via workerd) and production, Astro provides a default entrypoint that works for both scenarios.
What should I do?
Update your
wrangler.jsoncto use the new entrypoint:{ "main": "@​astrojs/cloudflare/entrypoints/server", }This single entrypoint handles both
astro devand production deployments.#15480
e118214Thanks @alexanderniebuhr! - Drops official support for Cloudflare Pages in favor of Cloudflare WorkersThe Astro Cloudflare adapter now only supports deployment to Cloudflare Workers by default in order to comply with Cloudflare's recommendations for new projects. If you are currently deploying to Cloudflare Pages, consider migrating to Workers by following the Cloudflare guide for an optimal experience and full feature support.
Minor Changes
#15435
957b9feThanks @rururux! - Adds support for configuring the image service as an object with separatebuildandruntimeoptionsIt is now possible to set both a build-time and runtime service independently. Currently,
'compile'is the only available build time option. The supported runtime options are'passthrough'(default) and'cloudflare-binding':See the Cloudflare adapter
imageServicedocs for more information about configuring your image service.#15077
a164c77Thanks @matthewp! - Adds support for prerendering pages using the workerd runtime.The Cloudflare adapter now uses the new
setPrerenderer()API to prerender pages via HTTP requests to a local preview server running workerd, instead of using Node.js. This ensures prerendered pages are built using the same runtime that serves them in production.#14306
141c4a2Thanks @ematipico! - Adds support forastro previewcommandDevelopers can now use
astro previewto test their Cloudflare Workers application locally before deploying. The preview runs using Cloudflare's workerd runtime, giving you a staging environment that matches production exactly—including support for KV namespaces, environment variables, and other Cloudflare-specific features.#15037
8641805Thanks @matthewp! - The Wrangler configuration file is now optional. If you don't have custom Cloudflare bindings (KV, D1, Durable Objects, etc.), Astro will automatically generate a default configuration for you.What should I do?
If your
wrangler.jsonconly contains basic configuration like this:{ "main": "@​astrojs/cloudflare/entrypoints/server", "compatibility_date": "2026-01-28", "assets": { "directory": "./dist", "binding": "ASSETS", }, }You can safely delete the file. Astro will handle this configuration automatically.
You only need a wrangler config file if you're using:
#15006
f361730Thanks @florian-lefebvre! - Adds new session driver object shapeFor greater flexibility and improved consistency with other Astro code, session drivers are now specified as an object:
Specifying the session driver as a string has been deprecated, but will continue to work until this feature is removed completely in a future major version. The object shape is the current recommended and documented way to configure a session driver.
#15556
8fb329bThanks @florian-lefebvre! - Adds support for more@cloudflare/vite-pluginoptionsThe adapter now accepts the following options from Cloudflare's Vite plugin:
auxiliaryWorkersconfigPathinspectorPortpersistStateremoteBindingsexperimental.headersAndRedirectsDevModeSupportFor example, you can now set
inspectorPortto provide a custom port for debugging your Workers:Patch Changes
#15044
7cac71bThanks @florian-lefebvre! - Removes an exposed internal API of the preview server#15080
f67b738Thanks @gameroman! - Updateswranglerdependency to be apeerDependencyover adependency#15039
6cc96e7Thanks @matthewp! - Fixes static content deployment by moving it to another folder, so Wrangler can tell the static and worker content apart#15452
e1aa3f3Thanks @matthewp! - Fixes server-side dependencies not being discovered ahead of time during developmentPreviously, imports in
.astrofile frontmatter were not scanned by Vite's dependency optimizer, causing a "new dependencies optimized" message and page reload when the dependency was first encountered. Astro is now able to scan these dependencies ahead of time.#15391
5d996ccThanks @florian-lefebvre! - Fixes types of thehandle()function exported from/handler, that could be incompatible with types generated bywrangler types#15696
a9fd221Thanks @Princesseuh! - Fixes duplicate logging showing up in some cases when prerendering pages#15309
4b9c8b8Thanks @ematipico! - Update the underneath@cloudflare/workers-typeslibrary to address a warning emitted by the package manager during the installation.#15079
4463a55Thanks @ascorbic! - Fixes auto-provisioning of default bindings (SESSION KV, IMAGES, and ASSETS). Default bindings are now correctly applied whether or not you have awrangler.jsonfile.Previously, these bindings were only added when no wrangler config file existed. Now they are added in both cases, unless you've already defined them yourself.
#15694
66449c9Thanks @matthewp! - Fixes deployment of static sites with the Cloudflare adapterFixes an issue with detecting and building fully static sites that caused deployment errors when using
output: 'static'with the Cloudflare adapter#15565
30cd6dbThanks @ematipico! - Fixes an issue where the use of theCodecomponent would result in an unexpected error.#15121
06261e0Thanks @ematipico! - Fixes a bug where the Astro, with the Cloudflare integration, couldn't correctly serve certain routes in the development server.#15026
90c608cThanks @matthewp! - Improves prebundling of internal Astro modules#15778
4ebc1e3Thanks @ematipico! - Fixes an issue where the computedclientAddresswas incorrect in cases of a Request header with multiple values. TheclientAddressis now also validated to contain only characters valid in IP addresses, rejecting injection payloads.#15669
d5a888bThanks @florian-lefebvre! - Removes thecssescdependencyThis CommonJS dependency could sometimes cause errors because Astro is ESM-only. It is now replaced with a built-in ESM-friendly implementation.
#15075
ee2c260Thanks @matthewp! - Adds deprecation errors forAstro.locals.runtimeproperties to help migrate from Astro v5 to v6When accessing the removed
Astro.locals.runtimeproperties on Cloudflare, developers now receive clear error messages explaining the migration path:Astro.locals.runtime.env→ Useimport { env } from "cloudflare:workers"Astro.locals.runtime.cf→ UseAstro.request.cfAstro.locals.runtime.caches→ Use the globalcachesobjectAstro.locals.runtime.ctx→ UseAstro.locals.cfContext#15336
9cce92eThanks @ascorbic! - Fixes a dev server issue where framework components from linked packages would fail to load with a 504 error.This could occur when using
client:onlyor other client directives with components from monorepo packages (linked viafile:or workspace protocol). The first request would trigger Vite's dependency optimizer mid-request, causing concurrent client module requests to fail.#15255
a66783aThanks @florian-lefebvre! - Fixes a case where the types ofhandle()could mismatch with the ones from the user's project. They now rely on globals, that can be obtained by runningwrangler types#15045
31074fcThanks @ematipico! - Fixes an issue where using the Vue integration with the Cloudflare adapter resulted in some runtime errors.#15386
a0234a3Thanks @OliverSpeir! - Updatesastro add cloudflareto use the latest validcompatibility_datein the wrangler config, if available#15432
e2ad69eThanks @OliverSpeir! - Removes unnecessary warning about sharp from being printed at start of dev server and build#15588
425ea16Thanks @rururux! - Fixes an issue whereesbuildwould throw a "Top-level return cannot be used inside an ECMAScript module" error during dependency scanning in certain environments.#15450
50c9129Thanks @florian-lefebvre! - Fixes a case wherebuild.serverEntrywould not be respected when using the new Adapter API#15030
b5aa52bThanks @ematipico! - Fixed an issue where the featureexperimental.chromeDevtoolsWorkspacewasn't supported by the new version of the adapter.#15648
802426bThanks @rururux! - Restore and fix<Code />component functionality on Cloudflare Workers.#15478
ee519e5Thanks @matthewp! - Fixes fully static sites to not output server-side worker code. When all routes are prerendered, the_worker.jsdirectory is now removed from the build output.#15636
5ecd04cThanks @florian-lefebvre! - Adds an error when running on Stackblitz, sinceworkerddoesn't support it#15269
6f82aaeThanks @ematipico! - Fixes a regression wherebuild.serverEntrystopped working as expected.#15798
05771cfThanks @rururux! - Fixes a regression where using the adapter would throw an error when using an integration that uses JSX.#15053
674b63fThanks @matthewp! - Excludesastro:*andvirtual:astro:*from client optimizeDeps in core. Needed for prefetch users since virtual modules are now in the dependency graph.#15495
5b99e90Thanks @leekeh! - Refactors to usemiddlewareModeadapter feature (set toclassic)Updated dependencies [
4ebc1e3,4e7f3e8,a164c77,cf6ea6b,a18d727,240c317,745e632]:v12.6.13Compare Source
Patch Changes
c2cd371]:v12.6.12Compare Source
Patch Changes
#14777
9720b70Thanks @iclectic! - Updates assets handling to use@astrojs/internal-helpersUpdated dependencies []:
v12.6.11Compare Source
Patch Changes
9e9c528,0f75f6b]:v12.6.10Compare Source
Patch Changes
b8ca69bThanks @ascorbic! - Refactor remote path detectionUpdated dependencies [
b8ca69b]:v12.6.9Compare Source
Patch Changes
1e2499e]:v12.6.8Compare Source
Patch Changes
#14326
c24a8f4Thanks @jsparkdev! - Updatesviteversion to fix CVEUpdated dependencies []:
withastro/astro (@astrojs/react)
v5.0.1Compare Source
Patch Changes
d3c7de9Thanks @florian-lefebvre! - Removes temporary support for Node >=20.19.1 because Stackblitz now uses Node 22 by defaultv5.0.0Compare Source
Major Changes
#14427
e131261Thanks @florian-lefebvre! - Increases minimum Node.js version to 22.12.0 - (v6 upgrade guidance)#14445
ecb0b98Thanks @florian-lefebvre! - Astro v6.0 upgrades to Vite v7.0 as the development server and production bundler - (v6 upgrade guidance)Minor Changes
72f7960Thanks @ocavue! - Update@vitejs/plugin-reactto v5.Patch Changes
#15187
bbb5811Thanks @matthewp! - Update to Astro 6 beta#15264
11efb05Thanks @florian-lefebvre! - Lower the Node version requirement to allow running on Stackblitz until it supports v22#15700
4e7f3e8Thanks @ocavue! - Improves how React components are identified when setting theincludeand/orexcludeoptions in projects where multiple JSX frameworks are used togetherUpdated dependencies [
4ebc1e3,4e7f3e8,a164c77,cf6ea6b,a18d727,240c317,745e632]:v4.4.2Compare Source
Patch Changes
#14715
3d55c5dThanks @ascorbic! - Adds support for client hydration ingetContainerRenderer()The
getContainerRenderer()function is exported by Astro framework integrations to simplify the process of rendering framework components when using the experimental Container API inside a Vite or Vitest environment. This update adds the client hydration entrypoint to the returned object, enabling client-side interactivity for components rendered using this function. Previously this required users to manually callcontainer.addClientRenderer()with the appropriate client renderer entrypoint.See the
container-with-vitestdemo for a usage example, and the Container API documentation for more information on using framework components with the experimental Container API.v4.4.1Compare Source
Patch Changes
e3175d9Thanks @GameRoMan! - Updatesviteversion to fix CVEv4.4.0Compare Source
Minor Changes
#14386
f75f446Thanks @yanthomasdev! - Stabilizes the formerly experimentalgetActionState()andwithState()functions introduced in@astrojs/reactv3.4.0 used to integrate Astro Actions with React 19'suseActionState()hook.This example calls a
likeaction that accepts apostIdand returns the number of likes. Pass this action to thewithState()function to apply progressive enhancement info, and apply touseActionState()to track the result:You can also access the state stored by
useActionState()from your action handler. CallgetActionState()with the API context, and optionally apply a type to the result:If you were previously using this experimental feature, you will need to update your code to use the new stable exports:
// src/components/Form.jsx import { actions } from 'astro:actions'; -import { experimental_withState } from '@​astrojs/react/actions'; +import { withState } from '@​astrojs/react/actions'; import { useActionState } from "react";// src/actions/index.ts import { defineAction, type SafeResult } from 'astro:actions'; import { z } from 'astro:schema'; -import { experimental_getActionState } from '@​astrojs/react/actions'; +import { getActionState } from '@​astrojs/react/actions';v4.3.1Compare Source
Patch Changes
c24a8f4Thanks @jsparkdev! - Updatesviteversion to fix CVEwithastro/astro (astro)
v6.0.6Compare Source
Patch Changes
#15965
2dca307Thanks @matthewp! - Fixes client hydration for components imported through Node.js subpath imports (package.json#imports, e.g.#components/*), for example when using the Cloudflare adapter in development.#15770
6102ca2Thanks @jpc-ae! - Updates thecreate astrowelcome message to highlight the graceful dev/preview server quit command rather than the kill process shortcut#15953
7eddf22Thanks @Desel72! - fix(hmr): eagerly recompile on style-only change to prevent stale slots render#15916
5201ed4Thanks @trueberryless! - FixesInferLoaderSchematype inference for content collections defined with a loader that includes aschema#15864
d3c7de9Thanks @florian-lefebvre! - Removes temporary support for Node >=20.19.1 because Stackblitz now uses Node 22 by default#15944
a5e1acdThanks @fkatsuhiro! - Fixes SSR dynamic routes with.htmlextension (e.g.[slug].html.astro) not working#15937
d236245Thanks @ematipico! - Fixes an issue where HMR didn't correctly work on Windows when adding/changing/deleting routes inpages/.#15931
98dfb61Thanks @Strernd! - Fix skew protection query params not being applied to island hydrationcomponent-urlandrenderer-url, and ensure query params are appended safely for asset URLs with existing search/hash parts.Updated dependencies []:
v6.0.5Compare Source
Patch Changes
#15891
b889231Thanks @matthewp! - Fix dev routing forserver:deferislands when adapters opt into handling prerendered routes in Astro core. Server island requests are now treated as prerender-handler eligible so prerendered pages usingprerenderEnvironment: 'node'can load island content without400errors.#15890
765a887Thanks @matthewp! - Fixesastro:actionsvalidation to check resolved routes, so projects using default static output with at least oneprerender = falsepage or endpoint no longer fail during startup.#15884
dcd2c8eThanks @matthewp! - Avoid aMaxListenersExceededWarningduringastro devstartup by increasing the shared Vite watcher listener limit when attaching content server listeners.#15904
23d5244Thanks @jlukic! - Emit thebefore-hydrationscript chunk for theclientVite environment. The chunk was only emitted forprerenderandssrenvironments, causing a 404 when browsers tried to load it. This broke hydration for any integration usinginjectScript('before-hydration', ...), including Lit SSR.#15933
325901eThanks @ematipico! - Fixes an issue where<style>tags inside SVG components weren't correctly tracked when enabling CSP.#15875
c43ef8aThanks @matthewp! - Ensure custom prerenderers are always torn down during build, even whengetStaticPaths()throws.#15887
1861fedThanks @ematipico! - Fixes an issue where the build incorrectly leaked server entrypoint into the client environment, causing adapters to emit warnings during the build.#15888
925252eThanks @matthewp! - Fix a bug whereserver:defercould fail at runtime in prerendered pages for some adapters (including Cloudflare), causing errors likeserverIslandMap?.get is not a function.#15901
07c1002Thanks @delucis! - Fixes JSON schema generation for content collection schemas that have differences between their input and output shapes.#15882
759f946Thanks @matthewp! - FixAstro.url.pathnamefor the root page when usingbuild.format: "file"so it resolves to/index.htmlinstead of/.htmlduring builds.v6.0.4Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
This PR was generated by Mend Renovate. View the repository job log.