# Nextjs + auth0 work at localhost, but return 404 while depoly to vercel

**URL:** <https://community.auth0.com/t/nextjs-auth0-work-at-localhost-but-return-404-while-depoly-to-vercel/112999>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [August 7, 2023, 3:54am UTC](https://community.auth0.com/t/nextjs-auth0-work-at-localhost-but-return-404-while-depoly-to-vercel/112999 "2023-08-07T03:54:45Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![onlinepenguin](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@onlinepenguin](https://community.auth0.com/u/onlinepenguin)\
**Post date:** [August 17, 2023, 2:16pm UTC](https://community.auth0.com/t/nextjs-auth0-work-at-localhost-but-return-404-while-depoly-to-vercel/112999/6 "2023-08-17T14:16:35Z")

</div>

Thank you tyf! I luckily found the solution to my particular issue - sharing here in case others encounter it.

I used the Next-Flask-Starter template, which routes calls to the Flask backend via a root-level api/ directory. Vercel didn’t like that there was this root-level api/ directory and then also the app/api/auth/… directory for auth0. As soon as I changed the Flask api/ route to something else, everything worked swimmingly.

---

_[View the full topic](https://community.auth0.com/t/nextjs-auth0-work-at-localhost-but-return-404-while-depoly-to-vercel/112999)._
