Packages

astro

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

Your version

4.10.3

17 Jun 2024Where it was published

4.16.19 is the newest release of 4.x.

In short

1 breaking2 new8 fixed

  • Breaking

    BREAKING CHANGE to the experimental astro:env feature only

Security

24 advisories affect 4.10.3; 7.4.5 fixes them

19 more

Release note

Patch Changes

  • Removes the PUBLIC_ prefix constraint for astro:env public variables

  • Breaking

    BREAKING CHANGE to the experimental astro:env feature only

    Server secrets specified in the schema must now be imported from astro:env/server. Using getSecret() is no longer required to use these environment variables in your schema:

    - import { getSecret } from 'astro:env/server'
    - const API_SECRET = getSecret("API_SECRET")
    + import { API_SECRET } from 'astro:env/server'

    Note that using getSecret() with these keys is still possible, but no longer involves any special handling and the raw value will be returned, just like retrieving secrets not specified in your schema.

  • Adds a new function called addServerRenderer to the Container API. Use this function to manually store renderers inside the instance of your container.

    This new function should be preferred when using the Container API in environments like on-demand pages:

    import type { APIRoute } from 'astro';
    import { experimental_AstroContainer } from 'astro/container';
    import reactRenderer from '@astrojs/react/server.js';
    import vueRenderer from '@astrojs/vue/server.js';
    import ReactComponent from '../components/button.jsx';
    import VueComponent from '../components/button.vue';
    
    // MDX runtime is contained inside the Astro core
    import mdxRenderer from 'astro/jsx/server.js';
    
    // In case you need to import a custom renderer
    import customRenderer from '../renderers/customRenderer.js';
    
    export const GET: APIRoute = async (ctx) => {
      const container = await experimental_AstroContainer.create();
      container.addServerRenderer({ renderer: reactRenderer });
      container.addServerRenderer({ renderer: vueRenderer });
      container.addServerRenderer({ renderer: customRenderer });
      // You can pass a custom name too
      container.addServerRenderer({
        name: 'customRenderer',
        renderer: customRenderer,
      });
      const vueComponent = await container.renderToString(VueComponent);
      return await container.renderToResponse(Component);
    };
  • Fixes a performance issue with JSON schema generation

  • Fixes a case where the virtual module astro:container wasn't resolved

  • Fixes a case where symlinked content collection directories were not correctly resolved

  • Adds a new error RewriteWithBodyUsed that throws when Astro.rewrite is used after the request body has already been read.

  • Fixes a prerendering issue for libraries in node_modules when a folder with an underscore is in the path.

  • Improves the developer experience of the custom 500.astro page in development mode.

    Before, in development, an error thrown during the rendering phase would display the default error overlay, even when users had the 500.astro page.

    Now, the development server will display the 500.astro and the original error is logged in the console.

  • Ignores query strings in module identifiers when matching ".astro" file extensions in Vite plugin

  • Refactors prerendering chunk handling to correctly remove unused code during the SSR runtime

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.