Packages

astro

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

Your version

4.11.0

20 Jun 2024Where it was published

4.16.19 is the newest release of 4.x.

In short

2 new9 fixed

Security

24 advisories affect 4.11.0; 7.4.5 fixes them

19 more

Release note

Minor Changes

  • Adds ShikiTransformer support to the <Code /> component with a new transformers prop.

    Note that transformers only applies classes and you must provide your own CSS rules to target the elements of your code block.

    ---
    import { transformerNotationFocus } from '@shikijs/transformers';
    import { Code } from 'astro:components';
    
    const code = `const foo = 'hello'
    const bar = ' world'
    console.log(foo + bar) // [!code focus]
    `;
    ---
    
    <Code {code} lang="js" transformers={[transformerNotationFocus()]} />
    
    <style is:global>
      pre.has-focused .line:not(.focused) {
        filter: blur(1px);
      }
    </style>
  • Improves the developer experience of the 500.astro file by passing it a new error prop.

    When an error is thrown, the special src/pages/500.astro page now automatically receives the error as a prop. This allows you to display more specific information about the error on a custom 500 page.

    ---
    // src/pages/500.astro
    interface Props {
      error: unknown;
    }
    
    const { error } = Astro.props;
    ---
    
    <div>{error instanceof Error ? error.message : 'Unknown error'}</div>

    If an error occurs rendering this page, your host's default 500 error page will be shown to your visitor in production, and Astro's default error overlay will be shown in development.

Patch Changes

  • Fixes a bug that prevented cookies from being set when using experimental rewrites

  • Drop duplicated brackets in data collections schema generation.

  • Fixes a case where rewriting / would cause an issue, when trailingSlash was set to "never".

  • Reverts a logic where it wasn't possible to rewrite /404 in static mode. It's now possible again

  • Fixes type generation for empty content collections

  • Improves type-checking and error handling to catch case where an image import is passed directly to getImage()

  • Fixes a case where defineAction autocomplete for the accept prop would not show "form" as a possible value

  • Corrects an inconsistency in dev where middleware would run for prerendered 404 routes.
    Middleware is not run for prerendered 404 routes in production, so this was incorrect.

  • Fixes an issue that would break Astro.request.url and Astro.request.headers in astro dev if HTTP/2 was enabled.

    HTTP/2 is now enabled by default in astro dev if https is configured in the Vite config.

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.