Skip to content

@clerk/astro doesn't support Astro v6 in Cloudflare - Error: Astro.locals.runtime.env has been removed #7849

@asdfjkalsdfla

Description

@asdfjkalsdfla

Description

When running the @clerk/astro middleware with cloudlfare, it produces the following error -
Error: Astro.locals.runtime.env has been removed in Astro v6. Use 'import { env } from "cloudflare:workers"' instead.

Looks like https://github.com/clerk/javascript/blob/2627442c1c38a5211bdcd707ca19b156c6a63e11/packages/astro/src/server/get-safe-env.ts need to be updated. The calls were removed in the Cloudflare adapter (withastro/astro#14306) and now produces an error (withastro/astro#15075).

Environment

System:
    OS: macOS 26.3
    CPU: (8) arm64 Apple M3
    Memory: 84.53 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.13.1 - /Users/richardwright/.nvm/versions/node/v24.13.1/bin/node
    npm: 11.8.0 - /Users/richardwright/.nvm/versions/node/v24.13.1/bin/npm
    pnpm: 10.24.0 - /Users/richardwright/Library/pnpm/pnpm
  Browsers:
    Chrome: 144.0.7559.133
    Firefox: 147.0.3
    Safari: 26.3
  npmPackages:
    @astrojs/cloudflare: 13.0.0-beta.7 => 13.0.0-beta.7 
    @astrojs/sitemap: ^3.7.0 => 3.7.0 
    @clerk/astro: 3.0.0-snapshot.v20260213202659 => 3.0.0-snapshot.v20260213202659 
    astro: 6.0.0-beta.11 => 6.0.0-beta.11 
    wrangler: ^4.65.0 => 4.65.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageA ticket that needs to be triaged by a team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions