Previewing VO app with next-auth 5

Hi, I want to confirm that it is possible to preview and iterate in v0 on a nextjs, next-auth app. The app currently runs in local development and runs in production deployed to vercel. The authentication works great.

When previewing the app in a v0 chat however it reports a runtime error of “next-auth“ module does not provide an export named “default“

Should I expect a next:15.5.2 next-auth:5.0.0-beta.29 app to work with V0? FWIW I have tried multiple combinations of versions of next and next-auth, with similar failed results. Is this a known limitation of the v0 runtime? Is there a way to inspect the module resolution used by the runtime? Clearly in production it does seem to have an export named default, or I think it would fail there as well.

Thanks,

Andy

Hi @whatisalwaystrue-146, welcome to the Vercel Community!

I’ve built next-auth apps previously but haven’t tried the latest version. Can you share the chat URL so I can fork and reproduce?

Thanks Anshuman, Here is a minimal reproduction of the issue. https://v0.app/chat/next-auth-app-efDNIj8SNP0

(I am new to v0 so if I didn’t share that correctly let me know)

In the linked chat I specifically asked it not to try to fix the runtime error, because every other time I have tried that, the chat solution has been to remove next-auth and hand roll a “custom“ auth system, which I would like to avoid.

I suspect you could duplicate it with any prompt of “build an app with the latest version of nextjs and next-auth”

Thanks! Andy

Hi @whatisalwaystrue-146, thanks for sharing the code. I was able to reproduce the issue. I’ll share it with our team but seems like v0 is not verse with the beta docs. So, I’d suggest to keep it off from the beta version if possible.

@anshumanb Here is a repo chat using the latest next-auth v4 with a runtime error that looks remarkably similar. https://v0.app/chat/next-auth-hello-world-sRnaYtFNUwW

Can you provide me with a chat where a basic hello world app can be previewed in v0 using next-auth?

I see. I’m unable to find an older chat which worked. New chats are giving me same issue as you said. Let me ask the team more into it.

@anshumanb Any updates on this? We will need to pivot to another approach if there is no timeframe to resolve this.

Thanks, Andy

Hi @whatisalwaystrue-146, sorry for the delay but I don’t have a concrete answer yet. I’d recommend using another auth solution if you are in a rush because I tried making Next Auth apps and it didn’t work well for me either.

@anshumanb Thanks. Before we give up on v0 completely and ask for a refund, is there a github repo where I could open an issue to get this addressed by development? Im really trying to give you guys a chance here.

Hi @whatisalwaystrue-146, I was able to get v4 working fine https://v0.app/chat/next-auth-v5-demo-pepmqdX9RN0.

However, I understand that this may not be enough for your use case so if you still wish to pursue another option, you can request a refund from http://vercel.com/help by providing all the information.

I am not seeing an import from next-auth in any of those source files. Are you sure it is being used?

@anshumanb With no resolution for this (I was hoping 16 might fix it) I have to ask for a refund. We will give you guys a try in the future

Hi @whatisalwaystrue-146, sorry I missed your response. And it seems like you’re right it ignore the v4 instruction.

For refund we’ll need to discuss private account information, it’s best to open a support case at vercel.com/help for this. Customers on all plan types are welcome to open a new case for any billing issue.

Just describe the problem to the AI chat bot and click the “Create Case” button that appears at the bottom of the chat window. The AI will autofill the form based on the info provided. Then, you can review and adjust any info in the form before submitting it to reach our billing experts.

Please let me know if you have any other questions :slightly_smiling_face: