-
SummaryI am trying to deploy a NextJS application to vercel. This is a test sign in model using AuthJS. When I run the program using
For context I am using NextJS 13 and it's app folder method of rendering pages along with the NextAuth.js.
This is my code found inside the route, and the relative path to this folder is Additional informationNo response ExampleNo response |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 30 replies
-
When you are in the development stage of your Next.js project, Typescript is allowed and is recognized during the runtime.
On the other hand, when you In your case, your
When you are working with Typescript, you do not need to write the filename extension such as In order to resolve your issue, try to remove the file extension |
Beta Was this translation helpful? Give feedback.
-
Solution: #50870 (comment) |
Beta Was this translation helpful? Give feedback.
-
existing documentation here is still not updated because of this -- how are newbies just implementing supposed to know |
Beta Was this translation helpful? Give feedback.
-
I'm getting this error after upgrading nextjs to 14 |
Beta Was this translation helpful? Give feedback.
-
For some reason I had |
Beta Was this translation helpful? Give feedback.
-
this solution works for me "next":14.0.4 |
Beta Was this translation helpful? Give feedback.
-
Thanks! The solution worked! 👍 |
Beta Was this translation helpful? Give feedback.
-
✅ Definitive Solution for Next.js 15 with
|
Beta Was this translation helpful? Give feedback.
Hello! I'd just liked to say what worked for me in the end is removing the export in front of
export const authOptions: NextAuthOptions
as that for some reason does not seem to work when building to production - this makes the solution viable for NextJS 13 using route handlers which requires route.ts to be the file for an endpoint. (This applies to my original code).I'd just like to say if this doesn't work for you - please refer to @devjiwonchoi's code which can be found above and is also very helpful for a number of optimisations in my project and Next in general.