Skip to content

When using @clerk/nextjs/webhooks with verifyWebhook(req) in an API route (app/api/users/webhook/route.ts), the build fails on Vercel (Next.js 15.3.4). #6212

@devlopermitesh

Description

@devlopermitesh

Preliminary Checks

Reproduction

https://github.com/devlopermitesh/Youtube

Publishable key

pk_test_bmljZS1jb3ctMzIuY2xlcmsuYWNjb3VudHMuZGV2JA

Description

🐛 Bug Report

When using @clerk/nextjs/webhooks with verifyWebhook(req) in an API route (app/api/users/webhook/route.ts), the build fails on Vercel (Next.js 15.3.4).

Even though the route is marked with:

export const dynamic = "force-dynamic";
export const runtime = "edge"; // OR even "nodejs"

TypeError: Cannot read properties of undefined (reading 'query')


### Environment

```Shell
System:
    OS: Windows 11
    CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
    Memory: 8 GB RAM
  Binaries:
    Node: 20.12.2
    npm: 10.5.0
    pnpm: 9.1.1
  Browsers:
    Chrome: 137.0.0.0
    Edge: 123.0.0.0
  npmPackages:
    next: 15.3.4
    @clerk/nextjs: 4.0.0
    drizzle-orm: 0.28.2
    @clerk/backend: 4.0.0
    typescript: 5.4.2

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy