NextAuth example works locally but fails on Zeit #11530
-
Hey all, In the NextAuth example (https://github.com/iaincollins/next-auth/tree/master/example), the file import React from 'react'
import Router from 'next/router'
import { NextAuth } from 'next-auth/client'
import Layout from '../../components/layout'
export default class extends React.Component {
static async getInitialProps({req}) {
return {
session: await NextAuth.init({req}),
linkedAccounts: await NextAuth.linked({req}),
providers: await NextAuth.providers({req})
}
}
render() {
...
}
} This page works perfectly fine when running locally, but unfortunately fails when deployed to Zeit using now. In the deployment, I get the following error: I tried troubleshooting this to no avail. I saw this note in the NextAuth documentation:
Based on this, I had a suspicion that Unfortunately, this didn't fix the problem. The page still shows a server error when it is loaded on the client. Would appreciate any help, and would be great to find out if this is an issue with NextAuth, Next.js, Zeit, or one of my minor modifications. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
This is an issue with |
Beta Was this translation helpful? Give feedback.
-
Hi @shea256 I am the lead maintainer of next-auth I can confirm, as @lfades says, that this problem is indeed an issue There is some good news though! You might want to check out next-auth.js.org for the beta of v2 or check out next-auth-example.now.sh for a demo.
NextAuth.js v2 is an open source community project. It's currently in beta and the current release candidate is looking good so far and we expect to release v2 out of beta in later this week. 🤞 |
Beta Was this translation helpful? Give feedback.
Hi @shea256
I am the lead maintainer of next-auth
I can confirm, as @lfades says, that this problem is indeed an issue
next-auth
v1 and not with to Next.js or now.sh. NextAuth.js v1 was created for now.sh v1 and is not compatible with now.sh from Vercel today and does not take advantage of features in recent versions of Next.js.There is some good news though!
You might want to check out next-auth.js.org for the beta of v2 or check out next-auth-example.now.sh for a demo.
npm next-auth@beta
NextAuth.js v2 is an open source community project. It's curr…