Packages

astro

7.4.13 · 18 Nov 2026MIT12.5M / weekRepositoryHomepagenpmAtom feed

Your version

4.12.3

30 Jul 2024Where it was published

4.16.19 is the newest release of 4.x.

In short

9 breaking2 fixed

  • Breaking

    BREAKING CHANGE to the experimental Actions API only. Install the latest @astrojs/react integration as well if you're using React 19 features.

  • Breaking

    Remove "SSR Only" mention in Astro.redirect inline documentation and update reference link.

  • Breaking

    Fixes a case where the build was failing when experimental.actions was enabled, an adapter was in use, and there were not actions inside the user code base.

  • Breaking

    Fixes line with the error not being properly highlighted in the error overlay

  • Breaking

    Allows actions to return falsy values without an error

  • Breaking

    Fixes an issue in content collection caching, where two documents with the same contents were generating an error during the build.

  • Breaking

    Fixes astro add for packages with only prerelease versions

  • Breaking

    Fixes DomException errors not being handled properly

Security

24 advisories affect 4.12.3; 7.4.5 fixes them

19 more

Release note

Patch Changes

  • Excludes hoisted scripts and styles from Astro components imported with ?url or ?raw

  • Uses the correct pageSize default in page.size JSDoc comment

  • Breaking

    BREAKING CHANGE to the experimental Actions API only. Install the latest @astrojs/react integration as well if you're using React 19 features.

    Make .safe() the default return value for actions. This means { data, error } will be returned when calling an action directly. If you prefer to get the data while allowing errors to throw, chain the .orThrow() modifier.

    import { actions } from 'astro:actions';
    
    // Before
    const { data, error } = await actions.like.safe();
    // After
    const { data, error } = await actions.like();
    
    // Before
    const newLikes = await actions.like();
    // After
    const newLikes = await actions.like.orThrow();

Migration

To migrate your existing action calls:

-   Remove `.safe` from existing _safe_ action calls  
-   Add `.orThrow` to existing _unsafe_ action calls
  • Breaking

    Remove "SSR Only" mention in Astro.redirect inline documentation and update reference link.

  • Breaking

    Fixes a case where the build was failing when experimental.actions was enabled, an adapter was in use, and there were not actions inside the user code base.

  • Breaking

    Fixes line with the error not being properly highlighted in the error overlay

  • Breaking

    BREAKING CHANGE to the experimental Actions API only. Install the latest @astrojs/react integration as well if you're using React 19 features.

    Updates the Astro Actions fallback to support action={actions.name} instead of using getActionProps(). This will submit a form to the server in zero-JS scenarios using a search parameter:

    ---
    import { actions } from 'astro:actions';
    ---
    
    <form action={actions.logOut}>
      <!--output: action="?_astroAction=logOut"-->
      <button>Log Out</button>
    </form>

    You may also construct form action URLs using string concatenation, or by using the URL() constructor, with the an action's .queryString property:

    ---
    import { actions } from 'astro:actions';
    
    const confirmationUrl = new URL('/confirmation', Astro.url);
    confirmationUrl.search = actions.queryString;
    ---
    
    <form method="POST" action={confirmationUrl.pathname}>
      <button>Submit</button>
    </form>

Migration

`getActionProps()` is now deprecated. To use the new fallback pattern, remove the `getActionProps()` input from your form and pass your action function to the form `action` attribute:

```diff
---
import {
  actions,
- getActionProps,
} from 'astro:actions';
---

+ <form method="POST" action={actions.logOut}>
- <form method="POST">
- <input {...getActionProps(actions.logOut)} />
  <button>Log Out</button>
</form>
```
  • Breaking

    Allows actions to return falsy values without an error

  • Breaking

    Fixes an issue in content collection caching, where two documents with the same contents were generating an error during the build.

  • Breaking

    Fixes astro add for packages with only prerelease versions

  • Breaking

    Fixes DomException errors not being handled properly

  • Breaking

    Fix server islands with trailingSlash: always

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.