Packages

astro

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

Your version

4.11.6

17 Jul 2024Where it was published

4.16.19 is the newest release of 4.x.

In short

3 new9 fixed

Security

24 advisories affect 4.11.6; 7.4.5 fixes them

19 more

Release note

Patch Changes

  • Fixes false positive audit warnings on elements with the role "tabpanel".

  • Avoids targeting all files in the src/ directory for eager optimization by Vite. After this change, only JSX, Vue, Svelte, and Astro components get scanned for early optimization.

  • Fixes prerendering not removing unused dynamic imported chunks

  • Fixes a case where Astro's config experimental.env.schema keys did not allow numbers. Numbers are still not allowed as the first character to be able to generate valid JavaScript identifiers

  • Expands the isInputError() utility from astro:actions to accept errors of any type. This should now allow type narrowing from a try / catch block.

    // example.ts
    import { actions, isInputError } from 'astro:actions';
    
    try {
      await actions.like(new FormData());
    } catch (error) {
      if (isInputError(error)) {
        console.log(error.fields);
      }
    }
  • Fixes an issue where using .nullish() in a formdata Astro action would always parse as a string

  • Exposes utility types from astro:actions for the defineAction handler (ActionHandler) and the ActionError code (ActionErrorCode).

  • Fixes astro dev --open unexpected behavior that spawns a new tab every time a config file is saved

  • Adds a new property experimental.env.validateSecrets to allow validating private variables on the server.

    By default, this is set to false and only public variables are checked on start. If enabled, secrets will also be checked on start (dev/build modes). This is useful for example in some CIs to make sure all your secrets are correctly set before deploying.

    // astro.config.mjs
    import { defineConfig, envField } from 'astro/config';
    
    export default defineConfig({
      experimental: {
        env: {
          schema: {
            // ...
          },
          validateSecrets: true,
        },
      },
    });
  • Expose new ActionReturnType utility from astro:actions. This infers the return type of an action by passing typeof actions.name as a type argument. This example defines a like action that returns likes as an object:

    // actions/index.ts
    import { defineAction } from 'astro:actions';
    
    export const server = {
      like: defineAction({
        handler: () => {
          /* ... */
          return { likes: 42 };
        },
      }),
    };

    In your client code, you can infer this handler return value with ActionReturnType:

    // client.ts
    import { actions, ActionReturnType } from 'astro:actions';
    
    type LikesResult = ActionReturnType<typeof actions.like>;
    // -> { likes: number }
  • Fixes astro:actions autocompletion for the defineAction accept property

  • Improves astro:env invalid variables errors

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.