Upgrade to Astro v6
This guide will help you migrate from Astro v5 to Astro v6.
Need to upgrade an older project to v5 first? See our older migration guide.
Need to see the v5 docs? Visit this older version of the docs site (unmaintained v5.18.0 snapshot).
Upgrade Astro
Section titled “Upgrade Astro”Update your project’s version of Astro to the latest version using your package manager:
# Upgrade Astro and official integrations togethernpx @astrojs/upgrade# Upgrade Astro and official integrations togetherpnpm dlx @astrojs/upgrade# Upgrade Astro and official integrations togetheryarn dlx @astrojs/upgradeYou can also upgrade your Astro integrations manually if needed, and you may also need to upgrade other dependencies in your project.
After upgrading Astro, you may not need to make any changes to your project at all!
But, if you notice errors or unexpected behavior, please check below for what has changed that might need updating in your project.
Astro v6.0 includes potentially breaking changes, as well as the removal and deprecation of some features.
If your project doesn’t work as expected after upgrading to v6.0, check this guide for an overview of all breaking changes and instructions on how to update your codebase.
See the Astro changelog for full release notes.
Dependency Upgrades
Section titled “Dependency Upgrades”Any major upgrades to Astro’s dependencies may cause breaking changes in your project.
Node 22
Section titled “Node 22”Node 18 reached its End of Life in March 2025 and Node 20 reached its End of Life in April 2026.
Astro v6.0 drops Node 18 and Node 20 support entirely so that all Astro users can take advantage of Node’s more modern features.
What should I do?
Section titled “What should I do?”Check that both your development environment and your deployment environment are using Node 22.12.0 or higher.
-
Check your local version of Node using:
Terminal window node -v -
Check your deployment environment’s own documentation to verify that they support Node 22.
You can specify Node
22.12.0for your Astro project either in a dashboard configuration setting or a.nvmrcfile..nvmrc 22.12.0
Vite 7.0
Section titled “Vite 7.0”Astro v6.0 upgrades to Vite v7.0 as the development server and production bundler.
What should I do?
Section titled “What should I do?”If you are using Vite-specific plugins, configuration, or APIs, check the Vite migration guide for their breaking changes and upgrade your project as needed.
Using Astro’s getViteConfig() helper requires at least Vitest v3.2 or v4.1 beta 5.
Vite Environment API
Section titled “Vite Environment API”Astro v6.0 introduces significant changes to how Astro manages different runtime environments (client, server, and prerender) after an internal refactor to use Vite’s new Environments API.
What should I do?
Section titled “What should I do?”Integration and adapter maintainers should pay special attention to changes affecting these parts of the Integration API and Adapter API (full details included below with other breaking changes to these APIs):
- Rollup output file name config path
- integration hooks and HMR access patterns
SSRManifeststructure- generating routes with
RouteData - routes with percent-encoded percent signs (e.g.
%25) astro:ssr-manifestvirtual moduleNodeAppfromastro/app/nodeloadManifest()andloadApp()fromastro/app/nodecreateExports()andstart()
Astro v6.0 upgrades to Zod 4, a major dependency update that may require changes to custom Zod schemas in your project.
What should I do?
Section titled “What should I do?”If you have custom Zod schemas in your content.config.ts or other configuration files, you’ll need to update them for Zod 4. Refer to the Zod migration guide for detailed changes in the Zod API.
Notably, many string() formats have been deprecated (e.g. z.string().email(), z.string().url()), and their APIs have been moved to the top-level z namespace. You may need to update how you validate form input for your Astro Actions:
email: z.string().email(),email: z.email(),Additionally, Zod has made some changes to handling error messages and has dropped support for a custom errorsMap which was useful to redefine or translate your error messages. You may need to update any custom error messages:
z.string().min(5, { message: "Too short." });z.string().min(5, { error: "Too short." });Also, if you use .default() with transforms, you may need to update your schemas. In Zod 4, default values must match the output type (after transforms), not the input type. The default value short-circuits parsing when the input is undefined:
import { z } from 'astro/zod';
const blog = defineCollection({ schema: z.object({ // Zod 3: default matched input type (string) views: z.string().transform(Number).default("0"), // Zod 4: default must match output type (number) views: z.string().transform(Number).default(0), })});For the old behavior where defaults are parsed, use the new .prefault() method.
These are only some of the many changes upgrading from Zod 3 to Zod 4. If you encounter any issues with your Zod schemas after upgrading to Astro 6, please consult the Zod 4 changelog for complete upgrade guidance.
Additionally, a community codemod, which can potentially automate some of these changes when migrating from Zod 3 to Zod 4, is also available.
You can ensure you’re using the same version of Zod that Astro uses internally by importing Zod from astro/zod.
import { z } from 'astro/zod';astro/zod module.
Shiki 4.0
Section titled “Shiki 4.0”Astro v6.0 upgrades to Shiki v4.0 for syntax highlighting.
What should I do?
Section titled “What should I do?”If you are using Shiki-specific APIs, check the Shiki migration guide for their breaking changes and upgrade your project as needed.
Official Astro integrations
Section titled “Official Astro integrations”All of Astro’s official server adapters have also updated to a new major version to accompany the upgrade to Vite v7.0 with Vite’s Environment API as the development server and production bundler.
In particular, Astro’s Cloudflare adapter has undergone significant changes, and breaking changes to your existing Cloudflare setup are expected.
What should I do?
Section titled “What should I do?”If you are using an Astro adapter for on-demand rendering or other platform-specific features, please check your specific adapter’s changelog for upgrade guidance:
@astrojs/cloudflareCHANGELOG@astrojs/netlifyCHANGELOG@astrojs/nodeCHANGELOG@astrojs/vercelCHANGELOG
Legacy
Section titled “Legacy”The following features are now considered legacy features. They should function normally but are no longer recommended and are in maintenance mode. They will see no future improvements and documentation will not be updated. These features will eventually be deprecated, and then removed entirely.
Legacy: content collections backwards compatibility
Section titled “Legacy: content collections backwards compatibility”In Astro 5.x, projects could delay upgrading to the new Content Layer API introduced for content collections because of some existing automatic backwards compatibility that was not previously behind a flag. This meant that it was possible to upgrade from Astro 4 to Astro 5 without updating your content collections, even if you had not enabled the legacy.collections flag. Projects would continue to build, and no errors or warnings would be displayed.
Astro v6.0 removes this automatic legacy content collections support, along with the legacy.collections flag. All content collections must now use the Content Layer API introduced in Astro v5.0 that powers all content collections.
What should I do?
Section titled “What should I do?”If you experience content collections errors after updating to v6, check your project for any removed legacy features that may need updating to the Content Layer API.
If you are unable to update immediately, you can enable the legacy.collectionsBackwardsCompat flag as a temporary migration helper:
export default defineConfig({ legacy: { collectionsBackwardsCompat: true, },});This flag preserves some legacy v4 content collections features:
- Supports the legacy configuration file
src/content/config.ts - Supports
type: 'content'andtype: 'data'without loaders - Preserves legacy entry API:
entry.slugandentry.render() - Uses path-based entry IDs instead of slug-based IDs
This is a temporary migration helper. Migrate your collections to the Content Layer API as soon as possible, then disable this flag.
Deprecated
Section titled “Deprecated”The following deprecated features are no longer supported and are no longer documented. Please update your project accordingly.
Some deprecated features may temporarily continue to function until they are completely removed. Others may silently have no effect, or throw an error prompting you to update your code.
Deprecated: Astro in getStaticPaths()
Section titled “Deprecated: Astro in getStaticPaths()”In Astro 5.x, it was possible to access an Astro object inside getStaticPaths(). However, despite being typed the same as the Astro object accessible in the frontmatter, this object only had site and generator properties. This could lead to confusion about which Astro object properties were available inside getStaticPaths().
Astro 6.0 deprecates this object for getStaticPaths() to avoid confusion and improves error handling when attempting to access Astro values that are unavailable. Using Astro.site or Astro.generator within getStaticPaths() will now log a deprecation warning, and accessing any other property will throw a specific error with a helpful message. In a future major version, this object will be removed entirely, and accessing Astro.site or Astro.generator will also throw an error.
What should I do?
Section titled “What should I do?”Update your getStaticPaths() function if you were attempting to access any Astro properties inside its scope. Remove Astro.generator entirely, and replace all occurrences of Astro.site with import.meta.env.SITE:
---import { getPages } from "../../../utils/data";
export async function getStaticPaths() { console.log(Astro.generator); return getPages(Astro.site); return getPages(import.meta.env.SITE);}---import.meta.env.SITE that are accessible when using getStaticPaths() to dynamically generate static routes.
Deprecated: import.meta.env.ASSETS_PREFIX
Section titled “Deprecated: import.meta.env.ASSETS_PREFIX”In Astro 5.x, it was possible to access build.assetsPrefix in your Astro config via the built-in environment variable import.meta.env.ASSETS_PREFIX. However, Astro v5.7.0 introduced the astro:config virtual module to expose a non-exhaustive, serializable, type-safe version of the Astro configuration which included access to build.assetsPrefix directly. This became the preferred way to access the prefix for Astro-generated asset links when set, although the environment variable still existed.
Astro 6.0 deprecates this variable in favor of build.assetsPrefix from the astro:config/server module.
What should I do?
Section titled “What should I do?”Replace any occurrences of import.meta.env.ASSETS_PREFIX with the build.assetsPrefix import from astro:config/server. This is a drop-in replacement to provide the existing value, and no other changes to your code should be necessary:
import { someLogic } from "./utils"import { build } from "astro:config/server"
someLogic(import.meta.env.ASSETS_PREFIX)someLogic(build.assetsPrefix)astro:config virtual module.
Deprecated: astro:schema and z from astro:content
Section titled “Deprecated: astro:schema and z from astro:content”In Astro 5.x, astro:schema was introduced as an alias of astro/zod. z was also exported from astro:content for convenience. However this occasionally created confusion for users who were unsure about where they should be importing from.
Astro 6.0 deprecates astro:schema and z from astro:content in favor of astro/zod.
What should I do?
Section titled “What should I do?”Replace any occurrences of astro:schema with astro/zod:
import { z } from "astro:schema"import { z } from "astro/zod"Remove z from your astro:content imports and import z separately from astro/zod instead:
import { defineCollection, z } from "astro:content"import { defineCollection } from "astro:content"import { z } from "astro/zod"Deprecated: exposed astro:transitions internals
Section titled “Deprecated: exposed astro:transitions internals”In Astro 5.x, some internals were exported from astro:transitions and astro:transitions/client that were not meant to be exposed for public use.
Astro 6.0 removes the following functions and types as exports from the astro:transitions and astro:transitions/client virtual modules. These can no longer be imported in your project files:
createAnimationScope()isTransitionBeforePreparationEvent()isTransitionBeforeSwapEvent()TRANSITION_BEFORE_PREPARATIONTRANSITION_AFTER_PREPARATIONTRANSITION_BEFORE_SWAPTRANSITION_AFTER_SWAPTRANSITION_PAGE_LOAD
What should I do?
Section titled “What should I do?”Remove any occurrences of createAnimationScope():
import { createAnimationScope } from 'astro:transitions';Update any occurrences of the other deprecated exports:
import { isTransitionBeforePreparationEvent, TRANSITION_AFTER_SWAP,} from 'astro:transitions/client';
console.log(isTransitionBeforePreparationEvent(event));console.log(event.type === 'astro:before-preparation');
console.log(TRANSITION_AFTER_SWAP);console.log('astro:after-swap');Deprecated: session driver string signature
Section titled “Deprecated: session driver string signature”In Astro 5.x, any unstorage provider name or a custom entrypoint could be provided to define a session driver, and options were also provided directly to the session configuration. However, we felt that this API was limited and inconsistent with other parts of the Astro config.
Astro 6.0 deprecates the driver string signature and options in favor of a new object shape.
What should I do?
Section titled “What should I do?”Update your session config to use the newly exported sessionDrivers:
import { defineConfig } from 'astro/config'import { defineConfig, sessionDrivers } from 'astro/config'
export default defineConfig({ session: { driver: 'redis', options: { url: process.env.REDIS_URL }, driver: sessionDrivers.redis({ url: process.env.REDIS_URL }), cookie: { secure: true }, ttl: 3600 }})Deprecated: NodeApp from astro/app/node (Adapter API)
Section titled “Deprecated: NodeApp from astro/app/node (Adapter API)”In Astro 5.x, adapters could implement their server entrypoint using App for standard web requests/responses, or NodeApp for node requests/responses.
Astro 6.0 deprecates NodeApp in favor of createApp() and new utilities: createRequest() and writeResponse(). This allows a more consistent API while preserving the same features as before. It also deprecates the NodeAppHeadersJson type.
What should I do?
Section titled “What should I do?”If you have built an adapter, update any usage of NodeApp with createApp():
import { NodeApp } from 'astro/app/node';
export function createExports(manifest) { const app = new NodeApp(manifest);
const handler = async (req, res) => { const response = await app.render(req); await NodeApp.writeResponse(response, res); };
return { handler };}import { createApp } from 'astro/app/entrypoint';import { createRequest, writeResponse } from 'astro/app/node';
const app = createApp();
export const handler = async (req, res) => { const request = createRequest(req); const response = await app.render(request); await writeResponse(response, res);}astro/app/node module.
Deprecated: loadManifest() and loadApp() from astro/app/node (Adapter API)
Section titled “Deprecated: loadManifest() and loadApp() from astro/app/node (Adapter API)”In Astro 5.x, the astro/app/node exposed loadManifest() and loadApp() utilities to allow loading the SSR manifest or a NodeApp instance from a URL instance. However, these were not documented and are no longer recommended usage with the v6 Adapter API.
Astro 6.0 deprecates both functions.
What should I do?
Section titled “What should I do?”If you have built an adapter, remove loadManifest() and replace loadApp() by createApp():
import { loadManifest, loadApp, NodeApp } from 'astro/app/node';
const manifest = await loadManifest(new URL(import.meta.url));const app1 = new NodeApp(loadManifest);const app2 = await loadApp(new URL(import.meta.url));import { createApp } from 'astro/app/entrypoint';
const app = createApp();astro/app/entrypoint module.
Deprecated: createExports() and start() (Adapter API)
Section titled “Deprecated: createExports() and start() (Adapter API)”In Astro 5.x, adapters had to provide the exports required by the host in their server entrypoint using a createExports() function before passing them to setAdapter() as an exports list.
Astro 6.0 introduces a simpler yet more powerful way of making server entrypoints. This relies on passing a new option entrypointResolution: "auto" to setAdapter().
However, for backwards compatibility with existing adapters, the default value of entrypointResolution ("explicit") mimics Astro 5.x API behavior. This means that your adapters can continue to function until you can fully migrate your adapter to the auto value, as shown below.
Note that entrypointResolution: "explicit" (maintaining v5 API behavior) is considered deprecated usage, but the option has been provided so that no immediate change to your adapter is required and to allow adapter authors time to update. This option will be removed in a future major version in favor of all adapters using entrypointResolution: "auto".
What should I do?
Section titled “What should I do?”If you are an adapter author with a public repository and include the astro-adapter keyword in your package.json, the Astro core team will attempt to make a PR to your repository directly to help you migrate your code if you have not yet followed the steps below.
If you are seeing warnings because you are using a community adapter that is not yet updated, please reach out to the adapter author directly to let them know. It is ultimately their responsibility to update their adapters. You can also let the Astro core team know in the #integrations channel of our Discord and we will attempt to help the adapter author upgrade.
If you have built an adapter, follow these steps to remove the legacy v5 behavior:
-
Update your
setAdapter(): setentrypointResolution: "auto", removeexportsandargsmy-adapter.mjs setAdapter({// ...entrypointResolution: 'auto',exports: ['handler'],args: { assets: config.build.assets }}) -
Update your server entrypoint to provide any required exports without
createExports():my-adapter/server.js import { App } from 'astro/app';export function createExports(manifest) {const app = new App(manifest);const handler = (event, context) => {// ...};return { handler };}import { createApp } from 'astro/app/entrypoint';const app = createApp();export const handler = (event, context) => {// ...} -
If your adapter provides a
start()function, update your server entrypoint to call the code directly:my-adapter/server.js import { App } from 'astro/app';export function start(manifest) {const app = new App(manifest);addEventListener('fetch', event => {// ...});}import { createApp } from 'astro/app/entrypoint';const app = createApp();addEventListener('fetch', event => {// ...}); -
If you were relying on
args, create a virtual module to pass the build time configuration and import them from the virtual module instead:my-adapter/server.js export function createExports(manifest, { assets }) {// ...}import { assets } from 'virtual:@example/my-adapter:config';
Removed
Section titled “Removed”The following features have now been entirely removed from the code base and can no longer be used. Some of these features may have continued to work in your project even after deprecation. Others may have silently had no effect.
Projects now containing these removed features will be unable to build, and there will no longer be any supporting documentation prompting you to remove these features.
Removed: legacy content collections
Section titled “Removed: legacy content collections”In Astro 5.x, it was still possible to use the original Content Collections API first introduced in Astro v2.0, either through a legacy configuration flag or via built-in backwards compatibility. These methods allowed you to upgrade to Astro v5 even if you were not yet ready or able to update your existing content collections to those powered by the new Content Layer API.
Astro v6.0 removes this previously deprecated Content Collections API support entirely, including the legacy.collections flag and some existing backwards compatibility that was not previously behind a flag. All content collections must now use the Content Layer API introduced in Astro v5.0 that powers all content collections. No backwards compatibility support is available.
What should I do?
Section titled “What should I do?”If you had previously enabled the legacy flag, you must remove it.
import { defineConfig } from 'astro/config';
export default defineConfig({ legacy: { collections: true, }})Additionally, if you did not upgrade your collections for Astro v5.0, ensure that your content collections are fully updated for the new API.
Astro v5.x included some automatic backwards compatibility to allow content collections to continue to work even if they had not been updated to use the new API. Therefore, your v5 collections may contain one or more legacy features that need updating to the newer API for v6, even if your project was previously error-free.
If you have content collections errors or warnings after upgrading to v6, use the following list to help you identify and upgrade any legacy features that may exist in your code.
If you have…
Section titled “If you have…”no content collections configuration file
Create src/content.config.ts and define your collections in it.
a configuration file located at
Rename and move this file to src/content/config.ts / (LegacyContentConfigError)src/content.config.ts
a collection that does not define a loader / (ContentCollectionMissingALoaderError)
Import Astro’s built-in glob() loader and define the pattern and base for your collection entries:
import { defineCollection } from 'astro:content';import { z } from 'astro/zod';import { glob } from 'astro/loaders';
const blog = defineCollection({ loader: glob({ pattern: '**/[^_]*.{md,mdx}', base: "./src/data/blog" }), schema: z.object({ title: z.string(), description: z.string(), pubDate: z.coerce.date(), updatedDate: z.coerce.date().optional(), }),});a collection that defines a collection type (
There are no longer different types of collections. This must be deleted from your collection definition.type: 'content' or type: 'data') / (ContentCollectionInvalidTypeError)
import { defineCollection } from 'astro:content';import { z } from 'astro/zod';import { glob } from 'astro/loaders';
const blog = defineCollection({ // For content layer you no longer define a `type` type: 'content', loader: glob({ pattern: '**/[^_]*.{md,mdx}', base: "./src/data/blog" }), schema: z.object({ title: z.string(), description: z.string(), pubDate: z.coerce.date(), updatedDate: z.coerce.date().optional(), }),});legacy collection querying methods
Replace both methods with getDataEntryById() and getEntryBySlug() / (GetEntryDeprecationError)getEntry().
legacy collection querying and rendering methods that depend on a
Previously, the slug property / (ContentSchemaContainsSlugError)id was based on the filename, and there was a slug property that could be used in a URL. Now the CollectionEntry id is a slug. If you need access to the filename (previously available as the id), use the filePath property. Replace instances of slug with id:
---export async function getStaticPaths() { const posts = await getCollection('blog'); return posts.map((post) => ({ params: { slug: post.slug }, params: { slug: post.id }, props: post, }));}---content rendered using
Collection entries no longer have a entry.render()render() method. Instead, import the render() function from astro:content and use render(entry):
---import { getEntry, render } from 'astro:content';
const post = await getEntry('pages', 'homepage');
const { Content, headings } = await post.render();const { Content, headings } = await render(post);---<Content />Removed: <ViewTransitions /> component
Section titled “Removed: <ViewTransitions /> component”In Astro 5.0, the <ViewTransitions /> component was renamed to <ClientRouter /> to clarify the role of the component. The new name makes it more clear that the features you get from Astro’s <ClientRouter /> routing component are slightly different from the native CSS-based MPA router. However, a deprecated version of the <ViewTransitions /> component still existed and may have functioned in Astro 5.x.
Astro 6.0 removes the <ViewTransitions /> component entirely and it can no longer be used in your project. Update to the <ClientRouter /> component to continue to use these features.
What should I do?
Section titled “What should I do?”Replace all occurrences of the ViewTransitions import and component with ClientRouter:
import { ViewTransitions } from 'astro:transitions';import { ClientRouter } from 'astro:transitions';
<html> <head> ... <ViewTransitions /> <ClientRouter /> </head></html>Removed: emitESMImage()
Section titled “Removed: emitESMImage()”In Astro 5.6.2, the emitESMImage() function was deprecated in favor of emitImageMetadata(), which removes two deprecated arguments that were not meant to be exposed for public use: _watchMode and experimentalSvgEnabled.
Astro 6.0 removes emitESMImage() entirely. Update to emitImageMetadata() to keep your current behavior.
What should I do?
Section titled “What should I do?”Replace all occurrences of the emitESMImage() with emitImageMetadata() and remove unused arguments:
import { emitESMImage } from 'astro/assets/utils';import { emitImageMetadata } from 'astro/assets/utils';
const imageId = '/images/photo.jpg';const result = await emitESMImage(imageId, false, false);const result = await emitImageMetadata(imageId);emitImageMetadata().
Removed: Astro.glob()
Section titled “Removed: Astro.glob()”In Astro 5.0, Astro.glob() was deprecated in favor of using getCollection() to query your collections, and import.meta.glob() to query other source files in your project.
Astro 6.0 removes Astro.glob() entirely. Update to import.meta.glob() to keep your current behavior.
What should I do?
Section titled “What should I do?”Replace all use of Astro.glob() with import.meta.glob(). Note that import.meta.glob() no longer returns a Promise, so you may have to update your code accordingly. You should not require any updates to your glob patterns.
---const posts = await Astro.glob('./posts/*.md');const posts = Object.values(import.meta.glob('./posts/*.md', { eager: true }));---
{posts.map((post) => <li><a href={post.url}>{post.frontmatter.title}</a></li>)}Where appropriate, consider using content collections to organize your content, which has its own newer, more performant querying functions.
You may also wish to consider using glob packages from NPM, such as fast-glob.
import.meta.glob.
Removed: exposed astro:actions internals
Section titled “Removed: exposed astro:actions internals”In Astro 5.x, some internals were exported from astro:actions that were not meant to be exposed for public use.
Astro 6.0 removes the following functions, classes and types as exports from the astro:actions virtual module. These can no longer be imported in your project files:
ACTION_ERROR_CODESActionInputErrorappendForwardSlashastroCalledServerErrorcallSafelydeserializeActionResultformDataToObjectgetActionQueryStringserializeActionResulttype Actionstype ActionAccepttype AstroActionContexttype SerializedActionResult
What should I do?
Section titled “What should I do?”Replace all imports of serializeActionResult() and deserializeActionResult() with getActionContext(). These two methods are now available through getActionContext():
import { defineMiddleware } from 'astro:middleware';import { serializeActionResult, deserializeActionResult } from 'astro:actions';import { getActionContext } from 'astro:actions';
export const onRequest = defineMiddleware(async (context, next) => { const { serializeActionResult, deserializeActionResult } = getActionContext(context); // ...});Remove any occurrences of the other removed exports:
import { ACTION_ERROR_CODES, ActionInputError, appendForwardSlash, astroCalledServerError, callSafely, formDataToObject, getActionQueryString, type Actions, type ActionAccept, type AstroActionContext, type SerializedActionResult,} from 'astro:actions';Removed: Percent-Encoding in routes
Section titled “Removed: Percent-Encoding in routes”In Astro 5.x, it was possible to include a percent-encoded percent sign (%25) in filenames.
Astro 6.0 removes support for the characters %25 in filenames for security reasons. This restriction prevents encoding-based security bypasses where %25 decodes to %, potentially leading to ambiguous or invalid encoding sequences.
What should I do?
Section titled “What should I do?”If you have route files with %25 in the filename, rename them to use a different character:
src/pages/test%25file.astrosrc/pages/test-file.astroRemoved: astro:ssr-manifest virtual module (Integration API)
Section titled “Removed: astro:ssr-manifest virtual module (Integration API)”In Astro 5.x, the deprecated astro:ssr-manifest virtual module could still be used to access configuration values.
Astro 6.0 removes the astro:ssr-manifest virtual module entirely. It is no longer used by integrations or internally by Astro. The manifest is now passed directly through integration hooks and adapter APIs rather than through a virtual module. For build-specific manifest data, use the astro:build:ssr integration hook, which receives the manifest as a parameter.
What should I do?
Section titled “What should I do?”If your integration or code imports from astro:ssr-manifest, use astro:config/server instead to access configuration values:
import { manifest } from 'astro:ssr-manifest';import { srcDir, outDir, root } from 'astro:config/server';// Use srcDir, outDir, root, etc. for configuration valuesastro:config virtual module.
Removed: RouteData.generate() (Adapter API)
Section titled “Removed: RouteData.generate() (Adapter API)”In Astro 5.x, routes could be generated using the generate() method on RouteData.
Astro 6.0 removes RouteData.generate() because route generation is now handled internally by Astro.
What should I do?
Section titled “What should I do?”Remove any calls to route.generate() in your code. This method is no longer needed:
const generated = route.generate(params);Removed: routes on astro:build:done hook (Integration API)
Section titled “Removed: routes on astro:build:done hook (Integration API)”In Astro 5.0, accessing routes on the astro:build:done hook was deprecated.
Astro 6.0 removes the routes array passed to this hook entirely. Instead, the astro:routes:resolved hook should be used.
What should I do?
Section titled “What should I do?”Remove any instance of routes passed to astro:build:done and replace it with the new astro:routes:resolved hook. Access distURL on the newly exposed assets map:
const integration = () => { let routes return { name: 'my-integration', hooks: { 'astro:routes:resolved': (params) => { routes = params.routes }, 'astro:build:done': ({ routes assets }) => { for (const route of routes) { const distURL = assets.get(route.pattern) if (distURL) { Object.assign(route, { distURL }) } } console.log(routes) } } }}astro:routes:resolved hook for building integrations.
Removed: entryPoints on astro:build:ssr hook (Integration API)
Section titled “Removed: entryPoints on astro:build:ssr hook (Integration API)”In Astro 5.0, functionPerRoute was deprecated. That meant that entryPoints on the astro:build:ssr hook was always empty.
Astro 6.0 removes the entryPoints map passed to this hook entirely.
What should I do?
Section titled “What should I do?”Remove any instance of entryPoints passed to astro:build:ssr:
const integration = () => { return { name: 'my-integration', hooks: { 'astro:build:ssr': (params) => { someLogic(params.entryPoints) }, } }}Removed: old app.render() signature (Adapter API)
Section titled “Removed: old app.render() signature (Adapter API)”In Astro 4.0, the app.render() signature that allowed passing routeData and locals as optional arguments was deprecated in favor of a single optional renderOptions argument.
Astro 6.0 removes this signature entirely. Attempting to pass these separate arguments will now cause an error in your project.
What should I do?
Section titled “What should I do?”Review your app.render() calls and pass routeData and locals as properties of an object instead of as multiple independent arguments:
app.render(request, routeData, locals)app.render(request, { routeData, locals })Removed: app.setManifestData() (Adapter API)
Section titled “Removed: app.setManifestData() (Adapter API)”In Astro 5.0, the app.setManifestData() method was available on App and NodeApp, but is no longer used nor needed.
Astro 6.0 removes this method entirely.
What should I do?
Section titled “What should I do?”Remove any call to app.setManifestData(). If you need to update the manifest, create a new App instance.
Removed: handleForms prop for the <ClientRouter /> component
Section titled “Removed: handleForms prop for the <ClientRouter /> component”In Astro 4.0, the handleForms prop of the <ClientRouter /> component was deprecated, as it was no longer necessary to opt in to handling submit events for form elements. This functionality has been built in by default and the property, if still included in your project, silently had no impact on form submission.
Astro 6.0 removes this prop entirely and it now must be removed to avoid errors in your project.
What should I do?
Section titled “What should I do?”Remove the handleForms property from your <ClientRouter /> component if it exists. It has provided no additional functionality, and so removing it should not change any behavior in your project:
---import { ClientRouter } from "astro:transitions";---<html> <head> <ClientRouter handleForms /> </head> <body> <!-- stuff here --> </body></html>