Next.js Discord

Discord Forum

error when deploying nextjs fullstack to vercel

Unanswered
Polar bear posted this in #help-forum
Open in Discord
Polar bearOP
error when deploying nextjs fullstack to vercel

Hello
I'm facing an issue when i make a fullstack application with next js
when you use getServerSession() from NextAuth in server component
or when you use mongodb and mongoose to fetch something from database



the page takes so much time to load and he gives you this error when you deploy to vercel

This Serverless Function has timed out.

Your connection is working correctly.

Vercel is working correctly.

504: GATEWAY_TIMEOUT
Code: FUNCTION_INVOCATION_TIMEOUT


do any one know the solution for this ?

8 Replies

Polar bearOP
what is solution
@Polar bear what is solution
reduce these times
Polar bearOP
can you tell me how to do that
@Polar bear can you tell me how to do that
Identify why it loads that long ... Maybe you are fetching to much, maybe your database server takes more than 10 seconds, ...
@Polar bear solved?
Polar bearOP
no
absolutely no
Polar bearOP
Hello
when i uploaded a video to firebase from nextjs project and tried to show it the console gives me this error

video:1 Access to video at 'https://firebasestorage.googleapis.com/v0/b/video-tutorial-6f559.firebasestorage.app/o/videos%2Fmysql%20-%20no%20connection%20established%20or%20unable%20to%20connect%20to%20local%20host.mp4?alt=media&token=b7f221ba-553f-4ca7-aaea-4e387666cc06' from origin 'http://localhost:3000/' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.


i think i must edit something in the rules in the firebase storage rules but i don't know what..
can you help me ?