Packages

@astrojs/netlify

8.2.14 · 13 Nov 2026MIT71.2k / weekRepositoryHomepagenpmAtom feed

Your version

7.0.0

major10 Mar 2026Where it was published

7.0.13 is the newest release of 7.x.

In short

1 breaking1 deprecated6 new7 fixed2 internal

  • Breaking

    Astro v6.0 upgrades to Vite v7.0 as the development server and production bundler - (v6 upgrade guidance)

  • Deprecated

    Adds new middlewareMode adapter feature and deprecates edgeMiddleware option

Security

Release note

Major Changes

  • Breaking

    Astro v6.0 upgrades to Vite v7.0 as the development server and production bundler - (v6 upgrade guidance)

Minor Changes

  • Stabilizes the adapter feature experimentalStatiHeaders. If you were using this feature in any of the supported adapters, you'll need to change the name of the flag:

    export default defineConfig({
      adapter: netlify({
    -    experimentalStaticHeaders: true
    +    staticHeaders: true
      })
    })
  • Adds support for the fit option to the image service

  • Deprecated

    Adds new middlewareMode adapter feature and deprecates edgeMiddleware option

    The edgeMiddleware option is now deprecated and will be removed in a future major release, so users should transition to using the new middlewareMode feature as soon as possible.

    export default defineConfig({
      adapter: netlify({
    -    edgeMiddleware: true
    +    middlewareMode: 'edge'
      })
    })
  • Adds new session driver object shape

    For greater flexibility and improved consistency with other Astro code, session drivers are now specified as an object:

    -import { defineConfig } from 'astro/config'
    +import { defineConfig, sessionDrivers } from 'astro/config'
    
    export default defineConfig({
      session: {
    -    driver: 'redis',
    -    options: {
    -      url: process.env.REDIS_URL
    -    },
    +    driver: sessionDrivers.redis({
    +      url: process.env.REDIS_URL
    +    }),
      }
    })

    Specifying the session driver as a string has been deprecated, but will continue to work until this feature is removed completely in a future major version. The object shape is the current recommended and documented way to configure a session driver.

  • Updates the implementation to use the new Adapter API

  • Removes the experimental.csp flag and replaces it with a new configuration option security.csp - (v6 upgrade guidance)

Patch Changes

  • Update to Astro 6 beta

  • Adds a new clientAddress option to the createContext() function

    Providing this value gives adapter and middleware authors explicit control over the client IP address. When not provided, accessing clientAddress throws an error consistent with other contexts where it is not set by the adapter.

    Additionally, both of the official Netlify and Vercel adapters have been updated to provide this information in their edge middleware.

    import { createContext } from 'astro/middleware';
    
    createContext({
      clientAddress: context.headers.get('x-real-ip'),
    });
  • Fixes builds that were failing with "Entry module cannot be external" error when using the Netlify adapter

    This error was preventing sites from building after recent internal changes. Your builds should now work as expected without any changes to your code.

  • Fixes server-rendered routes returning 404 errors

    A configuration error in the build output prevented Netlify from correctly routing requests to server-rendered pages, causing them to return 404 errors. This fix ensures that all server routes are properly handled by the Netlify SSR function.

  • Fixes the image CDN being used in development despite being disabled in certain cases

  • Updates to use the new Adapter API

  • Fixes a case where build.serverEntry would not be respected when using the new Adapter API

  • Updates to new Adapter API introduced in v6

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.