# Auth0 w/ NextJS and Vercel Not Working

**URL:** <https://community.auth0.com/t/auth0-w-nextjs-and-vercel-not-working/111123>\
**Category:** Get Help\
**Tags:** login-prompt-new-experience, login-experience\
**Created:** [July 12, 2023, 4:16pm UTC](https://community.auth0.com/t/auth0-w-nextjs-and-vercel-not-working/111123 "2023-07-12T16:16:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rmartin93](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rmartin93/32/48819_2.png) [@rmartin93](https://community.auth0.com/u/rmartin93)\
**Post date:** [July 12, 2023, 4:16pm UTC](https://community.auth0.com/t/auth0-w-nextjs-and-vercel-not-working/111123/1 "2023-07-12T16:16:08Z")

</div>

I’m trying to use Auth0 with Next.js for the first time, and I just can’t seem to make it work. I’ve tried using the auth0-react package and now I’m trying the nextjs-auth0 package.

I get a 500 error any time I try using the /api/auth/login route.

Here are the relevant pages of my repo

- [https://github.com/rmartin93/notes/blob/main/pages/\_app.js](https://github.com/rmartin93/notes/blob/main/pages/_app.js)
- [{siteTitle}](https://github.com/rmartin93/notes/blob/main/pages/login/index.js)
- [https://github.com/rmartin93/notes/blob/main/pages/api/auth/[auth0].js](https://github.com/rmartin93/notes/blob/main/pages/api/auth/%5Bauth0%5D.js)

I also created an .env.local, but for obvious reasons it’s in the .gitignore

It should be noted that the App Settings in the auth0 website won’t let me use localhost for any of the allowed urls since it’s not https. Idk what to do about that, but it could be the reason it’s not working. I tried making it work with my Vercel deployment instead, but that doesn’t work either.

If anybody knows what I’m doing wrong, please let me know.

---

<div class="post-metadata">

**Author:** ![rmartin93](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rmartin93/32/48819_2.png) [@rmartin93](https://community.auth0.com/u/rmartin93)\
**Post date:** [July 12, 2023, 4:18pm UTC](https://community.auth0.com/t/auth0-w-nextjs-and-vercel-not-working/111123/3 "2023-07-12T16:18:53Z")

</div>

When I say localhost, I mean something like [http://localhost:3000/](http://localhost:3000/)

Tried to put that in the original post, but there’s a link limit.

---

<div class="post-metadata">

**Author:** ![rmartin93](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rmartin93/32/48819_2.png) [@rmartin93](https://community.auth0.com/u/rmartin93)\
**Post date:** [July 12, 2023, 4:39pm UTC](https://community.auth0.com/t/auth0-w-nextjs-and-vercel-not-working/111123/4 "2023-07-12T16:39:23Z")

</div>

I realized I need to be using the Regular Application Type but changing that and updating my env didn’t work

---

<div class="post-metadata">

**Author:** ![rmartin93](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rmartin93/32/48819_2.png) [@rmartin93](https://community.auth0.com/u/rmartin93)\
**Post date:** [July 12, 2023, 4:45pm UTC](https://community.auth0.com/t/auth0-w-nextjs-and-vercel-not-working/111123/5 "2023-07-12T16:45:25Z")

</div>

Okay, for whatever reason, copying and pasting the example env file worked. I must’ve had a typo or something. I’m good to go.

---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [July 31, 2024, 9:05pm UTC](https://community.auth0.com/t/auth0-w-nextjs-and-vercel-not-working/111123/6 "2024-07-31T21:05:41Z")

</div>

Hey team!

This topic seems related to the new [Auth0 Integration](https://auth0.com/blog/auth0-vercel-integration/) available new in [Vercel Marketplace](https://vercel.com/integrations/auth0). This is the first version of this integration, and we welcome your feedback to improve future iterations.

You’ll need an [existing Vercel project](https://vercel.com/docs/projects/overview) to use the new integration to build and customize the Identity flow. You can either import your project into Vercel or use a Vercel template so you don’t have to start from scratch like our SaaStart template to deploy a production-ready B2B SaaS app in minutes (learn more [here](https://auth0.com/blog/speed-up-your-customer-identity-journey-with-auth0-saastart/)).

If you find yourself having questions regarding this new integration for the next two weeks, we are hosting an [Ask Me Anything session](https://community.auth0.com/t/auth0-community-ask-me-anything-integrating-auth0-within-the-vercel-marketplace/136388). Our Product Expert will provide comprehensive written answers on August 8th from 8 AM to 10 AM PST.

Find out more about [Auth0 Integration](https://auth0.com/blog/auth0-vercel-integration/) and [learn more about AMA](https://community.auth0.com/t/auth0-community-ask-me-anything-integrating-auth0-within-the-vercel-marketplace/136388).

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [August 14, 2024, 9:06pm UTC](https://community.auth0.com/t/auth0-w-nextjs-and-vercel-not-working/111123/7 "2024-08-14T21:06:38Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
