-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
TypeError: Object(...) is not a function #572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi there! I'm happy to have questions open, but please use the templates as requested and don't use the bug label for things that are not replicable bugs in NextAuth.js as it creates work for maintainers. |
@paragopinath I was having the same issue this afternoon, I reviewied the |
Hi there! It looks like this issue hasn't had any activity for a while. It will be closed if no further activity occurs. If you think your issue is still relevant, feel free to comment on it to keep ot open. Thanks! |
Hi there! It looks like this issue hasn't had any activity for a while. To keep things tidy, I am going to close this issue for now. If you think your issue is still relevant, just leave a comment and I will reopen it. (Read more at #912) Thanks! |
Hello, I'm having this problem. The error I'm getting is: You can recreate it by installing the next-auth library, and setting it up according to the docs at https://next-auth.js.org/getting-started/example. Note that it works when I clone the example repo, but when I try to implement it into my app, I get this error. |
We're also getting this error on |
I actually did. I just changed the versions of node and next-auth that I
was using and it started to work. Thanks!
…On Tue, Jun 28, 2022 at 18:38 Adam Duncan ***@***.***> wrote:
TypeError: next_auth_providers_google__WEBPACK_IMPORTED_MODULE_2__ is not
a function
We're also getting this error on ***@***.*** and Node v16.15.1. @bcrave
<https://github.com/bcrave> Did you track down a resolution on this one?
—
Reply to this email directly, view it on GitHub
<#572 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN64SGNYLHHXRC6E5EJMDETVRME75ANCNFSM4P4LD5NQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Good to hear, @bcrave. Which versions of Node/Next.js/next-auth worked for you in the end? Edit: FWIW we found ourselves being able to resolve this by explicitly calling |
I got this error after adding |
I had same problem with next 13.1.1, next-auth 4.18.7, react 18.2.0. This comment saved my day. Thank you. |
Edit: FWIW we found ourselves being able to resolve this by explicitly calling NextAuth.default(... and GoogleProvider.default(... — which makes us think this is a webpack v5/Next.js v12/React v17-18 versioning peculiarity. I also had the same issue I was following this guide "https://www.youtube.com/watch?v=A5ZN--P9vXM&list=PLNBstBbanNo-urO14JTnv7Jezq4XjOG_e&index=1&t=699s" I am using the following versions.
I updated my file @ /pages/api/auth/[...nextauth].js
To
This solved my issue thank you! 🥹 |
Hi, @blockspector or @adamduncan. Could either of you provide a snippet of your solution? I have the same issue and am having a hard time replicating with typescript as ".default" does not seem to exist on providers. next-auth: "next-auth": "^4.24.5" |
@epicmau5time Here's where we landed (using import NextAuth from 'next-auth';
import GoogleProvider from 'next-auth/providers/google';
export default NextAuth.default({
providers: [
GoogleProvider.default({
clientId: process.env.GOOGLE_CLIENT_ID,
clientSecret: process.env.GOOGLE_CLIENT_SECRET,
}),
],
}); |
Thank you @adamduncan your solution just saved me export default NextAuth({ to `import AzureADProvider from "next-auth/providers/azure-ad"; export default NextAuth.default({
as you said. Thank you so much |
I'm trying to add Social login buttons to a custom login page
I've imported the signIn function as follow
and then used the it on a custom button as follow
and when i click the button, i'm getting
TypeError: Object(...) is not a function
error. i'm using following versions of the packages"react": "^16.13.0",
"react-dom": "^16.13.0",
"next": "^9.3.6",
"next-auth": "^2.2.0",
Can anyone let me know where the issue might be ? Thank you!
The text was updated successfully, but these errors were encountered: