Skip to content

JWEInvalid: Invalid Compact JWE at async middleware #2048

Open
@dawidkubicki

Description

@dawidkubicki

Checklist

Description

Hello there,

I'm following the official guide https://github.com/auth0/nextjs-auth0 of implementing Auth0 auth with Next.js 15.2.4 App Router.

I am getting such error when running the app:

 ⨯ JWEInvalid: Invalid Compact JWE
    at async middleware (src/middleware.ts:6:9)
  4 |
  5 | export async function middleware(request: NextRequest) {
> 6 |   return await auth0.middleware(request)
    |         ^
  7 | }
  8 |
  9 | export const config = {

My package.json:

{
  "name": "frontend",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev --turbopack",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "@auth0/nextjs-auth0": "^4.4.2",
    "next
```": "15.2.4",
    "react": "^19.0.0",
    "react-dom": "^19.0.0"
  },
  "devDependencies": {
    "@eslint/eslintrc": "^3",
    "@tailwindcss/postcss": "^4",
    "@types/node": "^20",
    "@types/react": "^19",
    "@types/react-dom": "^19",
    "eslint": "^9",
    "eslint-config-next": "15.2.4",
    "tailwindcss": "^4",
    "typescript": "^5"
  }
}

I have done all the steps from the mentioned docs, also keeping in mind to have Regular Web Applications inside Auth0 applications.

Regards,
Dawid



### Reproduction

1. pnpm run dev

### Additional context

_No response_

### nextjs-auth0 version

4.4.2

### Next.js version

15.2.4

### Node.js version

20.12.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions