Skip to content

astro pre-render error: Astro2.locals.auth is not a function #7613

Description

@jphat

Preliminary Checks

Reproduction

https://github.com/jphat/clerk-astro

Publishable key

pk_test_dXAtbWl0ZS01MS5jbGVyay5hY2NvdW50cy5kZXYk

Description

Steps to reproduce:

  1. bun install
  2. bun run dev
  3. go to a pre-rendered blog page: http://localhost:4321/posts/post-1/

Expected behavior:

View blog page

Actual behavior:

without adding pre-render, I get this error
[WARN] [router] getStaticPaths() ignored in dynamic page /src/pages/posts/[...slug].astro. Add export const prerender = true; to prerender the page as static HTML during the build process

adding pre-render, I get this error
[ERROR] Astro2.locals.auth is not a function Stack trace: at /Users/josephat.1/Documents/Projects/clerk-astro-quickstart/node_modules/@clerk/astro/components/control/SignedOutSSR.astro:2:33 [...] See full stack trace in the browser, or rerun with --verbose.

Environment

System:
    OS: macOS 26.2
    CPU: (12) arm64 Apple M3 Pro
    Memory: 269.61 MB / 18.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    bun: 1.3.5 - /Users/.../.bun/bin/bun
  Browsers:
    Brave Browser: 144.1.86.139
    Chrome: 144.0.7559.60
    Edge: 143.0.3650.80
    Firefox: 147.0
    Safari: 26.2
  npmPackages:
    @astrojs/check: ^0.9.4 => 0.9.6 
    @astrojs/node: ^9.5.1 => 9.5.1 
    @clerk/astro: ^2.13.6 => 2.16.12 
    @types/bun: latest => 1.3.6 
    astro: ^5.14.1 => 5.16.9 
    prettier: ^3.6.2 => 3.8.0 
    prettier-plugin-astro: ^0.14.1 => 0.14.1 
    typescript: ^5.9.3 => 5.9.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions