Open adarshchhetri9 opened 8 months ago
could you provide more context about the problem you're facing.
By checking the Vercel logs, I managed to locate the issue. It turned out that I didn't pass the WEBHOOK_SECRET variable in Vercel, and I also failed to update the webhook URL after restarting the server in Vercel. I fixed these errors, and now everything is working correctly.
i have problem with Sync Clerk data my webhooks show failed requests but on my cluster db the User Db is created with out data sync. thank you !
I am unable to see the user data for the users I am logging within my mongoDb database. I have deployed everything correctly, even rechecked everything from MongoDb Url to webhook URL in my versel but I cannot just seem to figure out why can't I see the data of users logged in through userCreation in my MongoDb database. If anybody could help out please , I don't want to get stuck after almost halfway through :(
if the user is not being created inside the database, then you need to check whether you're running your app on local host or Vercel. The webhook secret key (Clerk) works when you host your app on Vercel. Go to clerk dashboard -> web hooks -> end points -> https://my-app.vercel.app/api/webhooks/clerk. make sure to host your app on vercel before creating this endpoint. after that try creating an account on imaginfy hosted at https://my-app.vercel.app/ .if you try to create an account on imaganify while running it on local host, the web hook won't work and the user created on clerk dashboard will not be stored inside mongo Db. hence causing the user not found error.
[GET] [middleware: "middleware"] / status=307 When running on production env, getting this error. Also getting this error log. I followed the same as shown in the video, tried all the options still dont understand what i am missing.
INFO: Clerk: The request to / is being redirected because there is no signed-in user, and the path is not included in ignoredRoutes
or publicRoutes
. To prevent this behavior, choose one of:
publicRoutes
array passed to authMiddlewareignoredRoutes: ["/((?!api|trpc))(_next.*|.+\.[\w]+$)", "/"]
to authMiddlewareafterAuth
to authMiddleware, and replace Clerk's default behavior of redirecting unless a route is included in publicRoutesFor additional information about middleware, please visit https://clerk.com/docs/nextjs/middleware
(This log only appears in development mode, or if debug: true
is passed to authMiddleware)
INFO: Clerk: The request to / is being redirected because there is no signed-in user, and the path is not included in ignoredRoutes
or publicRoutes
. To prevent this behavior, choose one of:
publicRoutes
array passed to authMiddlewareignoredRoutes: ["/((?!api|trpc))(_next.*|.+\.[\w]+$)", "/"]
to authMiddlewareafterAuth
to authMiddleware, and replace Clerk's default behavior of redirecting unless a route is included in publicRoutesthank you ! it work only on hosted app not on localhost
Same things it's work only on hosted app @lounes213
The issue is coming from MongoDB as the application cannot access the database based on the IP address captured during the setup process of your DB. To fix this issue;
thank you ! it work only on hosted app not on localhost
@lounes213 in the video at 1:38:00, in localhost I could not see any user database being added, does it only show on the deployed version?
if the user is not being created inside the database, then you need to check whether you're running your app on local host or Vercel. The webhook secret key (Clerk) works when you host your app on Vercel. Go to clerk dashboard -> web hooks -> end points -> https://my-app.vercel.app/api/webhooks/clerk. make sure to host your app on vercel before creating this endpoint. after that try creating an account on imaginfy hosted at https://my-app.vercel.app/ .if you try to create an account on imaganify while running it on local host, the web hook won't work and the user created on clerk dashboard will not be stored inside mongo Db. hence causing the user not found error.
it isn`t working for me. Do you have any other way to solve the problem?
Hi, I encountered the same, but after debugging, I found the response from the clerk over Google Oauth is changed, there is no "username" and "photo" attribute.
at the codebase please look at the user model, it requires these 2 attributes to create a user.
my hotfix is to remove the "require" attribute, so my user.model.ts look like below
userName: {
type: String,
},
photo: {
type: String,
},
Hi, I encountered the same, but after debugging, I found the response from the clerk over Google Oauth is changed, there is no "username" and "photo" attribute.
at the codebase please look at the user model, it requires these 2 attributes to create a user.
my hotfix is to remove the "require" attribute, so my user.model.ts look like below
userName: { type: String, }, photo: { type: String, },
Thanks man, this solved my issue
Hi, I encountered the same, but after debugging, I found the response from the clerk over Google Oauth is changed, there is no "username" and "photo" attribute. at the codebase please look at the user model, it requires these 2 attributes to create a user. my hotfix is to remove the "require" attribute, so my user.model.ts look like below
userName: { type: String, }, photo: { type: String, },
Thanks man, this solved my issue
Hi, I encountered the same, but after debugging, I found the response from the clerk over Google Oauth is changed, there is no "username" and "photo" attribute. at the codebase please look at the user model, it requires these 2 attributes to create a user. my hotfix is to remove the "require" attribute, so my user.model.ts look like below
userName: { type: String, }, photo: { type: String, },
Thanks man, this solved my issue
were you able to solved the issue and complete the project ?
the isssue lies in the clerk configuration you need to have username enabled to aunthenticate the user the right way
the isssue lies in the clerk configuration you need to have username enabled to aunthenticate the user the right way
can you please elaborate the right way?
@khadeem100 is correct, you don't need to change the code.
go to clerk setting, and enable username is require overthere then all should be good
ref: https://clerk.com/docs/authentication/configuration/sign-up-sign-in-options
Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received