# Module '"@auth0/nextjs-auth0"' has no exported member 'handleAuth'

**URL:** <https://community.auth0.com/t/module-auth0-nextjs-auth0-has-no-exported-member-handleauth/183138>\
**Category:** Get Help\
**Tags:** other, community-topic\
**Created:** [March 3, 2025, 4:20am UTC](https://community.auth0.com/t/module-auth0-nextjs-auth0-has-no-exported-member-handleauth/183138 "2025-03-03T04:20:01Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![pj2025](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pj2025/32/71348_2.png) [@pj2025](https://community.auth0.com/u/pj2025)\
**Post date:** [March 3, 2025, 4:20am UTC](https://community.auth0.com/t/module-auth0-nextjs-auth0-has-no-exported-member-handleauth/183138/1 "2025-03-03T04:20:01Z")

</div>

In my nextjs app, and inside “\src\app\api\auth[…auth0]\route.ts”  
I’m importing handle auth from nextjs-auth0 sdk but it gives error of no exported member.

> import { handleAuth } from ‘@auth0/nextjs-auth0’;

the sdk is installed and the version is ^4.0.2.

> “dependencies”: {  
> “@auth0/nextjs-auth0”: “^4.0.2”,

Am I doing something wrong?

---

<div class="post-metadata">

**Author:** ![pj2025](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pj2025/32/71348_2.png) [@pj2025](https://community.auth0.com/u/pj2025)\
**Post date:** [March 3, 2025, 3:09pm UTC](https://community.auth0.com/t/module-auth0-nextjs-auth0-has-no-exported-member-handleauth/183138/2 "2025-03-03T15:09:20Z")

</div>

My nextjs version is also latest, all the dependencies are latest ones.

---

<div class="post-metadata">

**Author:** ![pj2025](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pj2025/32/71348_2.png) [@pj2025](https://community.auth0.com/u/pj2025)\
**Post date:** [March 4, 2025, 1:44pm UTC](https://community.auth0.com/t/module-auth0-nextjs-auth0-has-no-exported-member-handleauth/183138/3 "2025-03-04T13:44:45Z")

</div>

any help here please?

---

<div class="post-metadata">

**Author:** ![pj2025](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pj2025/32/71348_2.png) [@pj2025](https://community.auth0.com/u/pj2025)\
**Post date:** [March 5, 2025, 4:52am UTC](https://community.auth0.com/t/module-auth0-nextjs-auth0-has-no-exported-member-handleauth/183138/4 "2025-03-05T04:52:15Z")

</div>

Can anyone help please? I’m trying but there is no clear docs update that handleAuth is not supported. I even tried to create a new nextjs app just to check but same error: Module ‘“@auth0/nextjs-auth0”’ has no exported member ‘handleAuth’.

---

<div class="post-metadata">

**Author:** ![itjustcarlos](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/itjustcarlos/32/61059_2.png) [@itjustcarlos](https://community.auth0.com/u/itjustcarlos)\
**Post date:** [March 6, 2025, 8:32pm UTC](https://community.auth0.com/t/module-auth0-nextjs-auth0-has-no-exported-member-handleauth/183138/5 "2025-03-06T20:32:58Z")

</div>

have the same issue, so sadly don’t have a solution yet. Gemini has some other recommendations, but throw same error

---

<div class="post-metadata">

**Author:** ![itjustcarlos](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/itjustcarlos/32/61059_2.png) [@itjustcarlos](https://community.auth0.com/u/itjustcarlos)\
**Post date:** [March 6, 2025, 9:04pm UTC](https://community.auth0.com/t/module-auth0-nextjs-auth0-has-no-exported-member-handleauth/183138/6 "2025-03-06T21:04:13Z")

</div>

I deleted `route.ts` and it worked 🤷

---

<div class="post-metadata">

**Author:** ![pj2025](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pj2025/32/71348_2.png) [@pj2025](https://community.auth0.com/u/pj2025)\
**Post date:** [March 7, 2025, 1:36pm UTC](https://community.auth0.com/t/module-auth0-nextjs-auth0-has-no-exported-member-handleauth/183138/7 "2025-03-07T13:36:47Z")

</div>

instead route.ts  
using lib/auth0.ts works  
import { Auth0Client } from “@auth0/nextjs-auth0/server”

export const auth0 = new Auth0Client();

and a middleware.ts

---

<div class="post-metadata">

**Author:** ![pj2025](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pj2025/32/71348_2.png) [@pj2025](https://community.auth0.com/u/pj2025)\
**Post date:** [March 7, 2025, 1:37pm UTC](https://community.auth0.com/t/module-auth0-nextjs-auth0-has-no-exported-member-handleauth/183138/8 "2025-03-07T13:37:16Z")

</div>

but my setup is different so i won’t be using middleware.ts here

---

<div class="post-metadata">

**Author:** ![Ibkdir](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ibkdir/32/73969_2.png) [@Ibkdir](https://community.auth0.com/u/Ibkdir)\
**Post date:** [March 29, 2025, 6:04am UTC](https://community.auth0.com/t/module-auth0-nextjs-auth0-has-no-exported-member-handleauth/183138/9 "2025-03-29T06:04:08Z")

</div>

In the latest version, the auth0/nextjs-auth0 github specifies that the SDK automatically mounts the main authentication-related routes:

```auto
import { Auth0Client } from "@auth0/nextjs-auth0/server"

export const auth0 = new Auth0Client()

```

The following routes are automatically mounted:

1. `/auth/login`
2. `/auth/logout`
3. `/auth/callback`
4. `/auth/profile`
5. `/auth/access-token`
6. `/auth/backchannel-logout`

---

<div class="post-metadata">

**Author:** ![matthew.hartz](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/matthew.hartz/32/12776_2.png) [@matthew.hartz](https://community.auth0.com/u/matthew.hartz)\
**Post date:** [May 7, 2025, 8:31pm UTC](https://community.auth0.com/t/module-auth0-nextjs-auth0-has-no-exported-member-handleauth/183138/10 "2025-05-07T20:31:18Z")

</div>

@pj2025 you figure this out? I can’t use middleware either.
