Breaking Changes

Astro 7’s breaking changes are manageable because they cluster into a few buckets.

Upgrade Risk Map

ChangeRiskWho Cares
Vite 8Mediumcustom Vite plugins, advanced build config, plugin authors
Rust compilerMediumprojects with invalid .astro markup that used to pass
Sätteri defaultMediumprojects using remark, rehype, or recma plugins
compressHTML: 'jsx'Mediumtemplates relying on newline whitespace between inline elements
src/fetch.ts reservedLow to mediumprojects already using that filename
Experimental flags removedLowprojects that opted into Astro 6 experimental features
@astrojs/db removedHigh if usedprojects using Astro DB commands/package
astro:transitions internals removedLowprojects importing deprecated transition internals

Removed Experimental Flags

Move stable configuration out of experimental, and delete flags that are now the default:

import { defineConfig, memoryCache } from 'astro/config';

export default defineConfig({
  cache: {
    provider: memoryCache(),
  },
  routeRules: {
    '/blog/[...path]': { maxAge: 300, swr: 60 },
  },
});

Delete old flags for:

  • experimental.logger
  • experimental.queuedRendering
  • experimental.rustCompiler
  • experimental.advancedRouting
  • experimental.cache
  • experimental.routeRules

Rust Compiler Strictness

The Rust compiler does less browser-like correction. That is good long-term, but it exposes real template bugs.

---
import Layout from '../layouts/Layout.astro';
---

<!-- Broken: Layout is never closed -->
<Layout>
  <p>Content here</p>

Fix it by closing non-void elements and using valid nesting:

---
import Layout from '../layouts/Layout.astro';
---

<Layout>
  <p>Content here</p>
</Layout>

Gotcha: If your page visually changes without a compile error, check invalid HTML nesting first. The old compiler could silently move elements around. Astro 7 leaves the browser to parse what you wrote.

Whitespace Default

compressHTML now defaults to 'jsx'. Newlines between inline elements no longer guarantee visible spaces.

<!-- May render as "helloworld" -->
<span>hello</span>
<em>world</em>

<!-- Explicit space -->
<span>hello</span> <em>world</em>

If the visual diff is too large to fix immediately, you can temporarily restore the old behavior:

import { defineConfig } from 'astro/config';

export default defineConfig({
  compressHTML: true,
});

Use that as a migration crutch, not the default answer.

Removed APIs

Replace or remove these:

Removed/deprecatedReplacement
@astrojs/dbNode node:sqlite, Drizzle, or a database library for your host
TRANSITION_AFTER_SWAP and related transition internalsliteral lifecycle event names like astro:after-swap
getContainerRenderer() from integration root@astrojs/react/container-renderer and equivalent integration entrypoints