Skip to content
24 changes: 24 additions & 0 deletions src/content/docs/en/guides/upgrade-to/v6.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1307,6 +1307,30 @@ export function getStaticPaths() {

<ReadMore>Learn more about [dynamic SSG routes with `getStaticPaths()`](/en/guides/routing/#static-ssg-mode).</ReadMore>

### Changed: Astro components cannot be rendered in Vitest client environments (Container API)

<SourcePR number="14895" title="feat: remove Vitest workaround for client environment"/>

In Astro 5.x, rendering an Astro component on the client was forbidden. However we temporarily allowed this behavoir in Vitest client environments such as `jsdom` or `happy-dom` using the [experimental Container API](/en/reference/container-reference/).

Astro 6.0 removes the ability to render Astro components in Vitest client environments: tests that render Astro components must now run in a server environment like `node`.

#### What should I do?

If you use Vitest to run tests that render Astro components in client environments like `jsdom` or `happy-dom`, update your Vitest config to use the `node` environment for these:
```ts title="vitest.config.ts" del={5} ins={6}
import { defineConfig } from 'vitest/config';

export default defineConfig({
test: {
environment: 'jsdom',
environment: 'node',
},
});
```

<ReadMore>Learn more about [testing Astro components](/en/guides/testing/).</ReadMore>

### Changed: Integration hooks and HMR access patterns (Integration API)

<SourcePR number="14306" title="feat: integrate vite environments"/>
Expand Down