threads icon indicating copy to clipboard operation
threads copied to clipboard

This Serverless Function has timed out.Your connection is working correctly. Vercel is working correctly.

Open jaydeeprana049 opened this issue 2 years ago • 20 comments

please reply guys for this error.

jaydeeprana049 avatar Aug 06 '23 17:08 jaydeeprana049

Check External API Calls: Split Functionality: Optimize Your Code: Use Asynchronous Operations:Check your code and again review this point

yuvraj042003 avatar Aug 07 '23 06:08 yuvraj042003

Check External API Calls: Split Functionality: Optimize Your Code: Use Asynchronous Operations:Check your code and again review this point

Bro please can you help me bit. I am new to Nextjs . I did not understand can you explain me in detail . Help me bro

jaydeeprana049 avatar Aug 07 '23 07:08 jaydeeprana049

image This Edge Function has crashed.

Your connection is working correctly.

Vercel is working correctly. how to add .env file in vercel deploy

sagarbagwe avatar Aug 08 '23 16:08 sagarbagwe

did ya figure it out?

Op-Pautu avatar Aug 21 '23 07:08 Op-Pautu

Check External API Calls: Split Functionality: Optimize Your Code: Use Asynchronous Operations:Check your code and again review this point

Bro please can you help me bit. I am new to Nextjs . I did not understand can you explain me in detail . Help me bro

Yes Where you got the error tell me.

yuvraj042003 avatar Aug 24 '23 02:08 yuvraj042003

image This Edge Function has crashed. Your connection is working correctly.

Vercel is working correctly. how to add .env file in vercel deploy

When you deploy your project then follew these steps:-

  1. Open your project link go to varcel.
  2. Go to Setting.
  3. Go to Enviornment Veriable.
  4. Copy Each and envery .env.local file string and correspoded to secrekey and paste here. Then Your Project work well.

yuvraj042003 avatar Sep 09 '23 01:09 yuvraj042003

Its a mongoDB error, just change your network access setting and change the ip to 0.0.0.0

aftab404 avatar Sep 23 '23 22:09 aftab404

Its a mongoDB error, just change your network access setting and change the ip to 0.0.0.0

lmao. it was that easy. thanks

Op-Pautu avatar Sep 26 '23 18:09 Op-Pautu

@aftab404 Thanks. I was stumbled whole day for this error.

pemawangchuk2023 avatar Nov 24 '23 11:11 pemawangchuk2023

Its a mongoDB error, just change your network access setting and change the ip to 0.0.0.0

thanks

greatrifat avatar Dec 15 '23 13:12 greatrifat

Its a mongoDB error, just change your network access setting and change the ip to 0.0.0.0

ok, does this happen because the app is trying to access the db but this ap is not added to have access, thus creating the error?

raresamza avatar Jan 18 '24 21:01 raresamza

0.0.0.0 means anyone can access your backend, else you can check your specific pc or server ip and use that instead

On Thu 18. Jan 2024 at 10:11 PM, Rares @.***> wrote:

Its a mongoDB error, just change your network access setting and change the ip to 0.0.0.0

ok, does this happen because the app is trying to access the db but this ap is not added to have access, thus creating the error?

— Reply to this email directly, view it on GitHub https://github.com/adrianhajdin/threads/issues/22#issuecomment-1899210593, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOE6WIJV5JXIFVRHIQQ5IW3YPGFZFAVCNFSM6AAAAAA3GBMXXKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJZGIYTANJZGM . You are receiving this because you were mentioned.Message ID: @.***>

aftab404 avatar Jan 18 '24 21:01 aftab404

Its a mongoDB error, just change your network access setting and change the ip to 0.0.0.0

Bro, you save my day.

harrisblog avatar Mar 18 '24 17:03 harrisblog

Its a mongoDB error, just change your network access setting and change the ip to 0.0.0.0

it was 0.0.0.0 by default, error is not solved

sem22-dev avatar Apr 15 '24 16:04 sem22-dev

how can i solve this issue,,

mr9asif avatar May 07 '24 14:05 mr9asif

it was 0.0.0.0 by default.

Got the same error.

This can happen when your database is not connected,

In my case , it got fixed when (i successfully connect to mongodb) i.e i add await connectMongoDB(); just before calling "await User.findOne()"

example : //connectMongoDB looks like this :

import mongoose from "mongoose"; export const connectMongoDB = async () => { try { await mongoose.connect(process.env.MONGODB_URI); console.log("Connected to MongoDB"); } catch (error) { console.log("Error connecting to MongoDB: ", error); } }; //part of callback function in auth.ts

import { connectMongoDB } from '@/lib/mongodb'; async session({ session }) { await connectMongoDB(); if (session?.user?.email) { const sessionUser = await User.findOne({ email: session.user.email }); if (sessionUser) { // Safely assign id only if sessionUser is found session.user.id = sessionUser._id.toString(); console.log('userId', session.user.id); } } return session; },

sem22-dev avatar May 08 '24 08:05 sem22-dev

Its a mongoDB error, just change your network access setting and change the ip to 0.0.0.0

AAA SI HAPPY WITH THIS!

daffaputraa avatar Aug 22 '24 09:08 daffaputraa

Its a mongoDB error, just change your network access setting and change the ip to 0.0.0.0

God bless you.......

Its working

saifullah1088 avatar Nov 01 '24 08:11 saifullah1088

Its a mongoDB error, just change your network access setting and change the ip to 0.0.0.0

GOD 🛐

kalashvasaniya avatar Nov 16 '24 18:11 kalashvasaniya