Replies: 61 comments 33 replies
-
I'm experiencing the same issue. In dev, the first route change takes a while and every subsequent one (even when the server fetched data is different!) is almost instant. In prod, every route change to a component with Any ideas on what might be causing this? |
Beta Was this translation helpful? Give feedback.
-
Also having the same thing, getServerSideProps, seems to just take such a long time? |
Beta Was this translation helpful? Give feedback.
-
I have no fix but I added a loading indicator for UX...
|
Beta Was this translation helpful? Give feedback.
-
Same here, I've added an NProgress indicator which makes it a little more obvious that something is being loaded. However, the (bug?) still persist and I'm wondering whether anyone has experienced the same thing and found a solution. |
Beta Was this translation helpful? Give feedback.
-
Same problem, looking for some 'best practices' on this topic |
Beta Was this translation helpful? Give feedback.
-
any fix to this yet? |
Beta Was this translation helpful? Give feedback.
-
bump. Sometimes takes > 7 seconds in production even if getServerSideProps doesn't even make an api call! |
Beta Was this translation helpful? Give feedback.
-
I've noticed this as well |
Beta Was this translation helpful? Give feedback.
-
any update for this problems? i have same issue.. |
Beta Was this translation helpful? Give feedback.
-
I have same problem on this with cookies check and Vercel show "504: GATEWAY_TIMEOUT" |
Beta Was this translation helpful? Give feedback.
-
Anyone update to latest next.js package? Worked for discussion below. |
Beta Was this translation helpful? Give feedback.
-
update to "next": "12.1.0" solved my problem. |
Beta Was this translation helpful? Give feedback.
-
Still experiencing this. Could be beacasue the amount of imports? |
Beta Was this translation helpful? Give feedback.
-
Added my other 2 main pages here: https://screenbud.com/s/RVoMPSVDhrc initial loadup time went down from 10-20secs to ~0 |
Beta Was this translation helpful? Give feedback.
-
got this solution while searching for this bug
issue: #13910 |
Beta Was this translation helpful? Give feedback.
-
In a lot of cases, this is most likely due to serverless function cold starts and the Node.js runtime booting. It depends on various factors, such as the dependencies inside your function. By switching to This article describes the issue for projects hosted on Vercel. |
Beta Was this translation helpful? Give feedback.
-
We're currently experiencing this outside of Vercel, in standalone mode where Next is deployed in a Docker container running on Cloud Run (in CPU always allocated configuration with minimum number of instances set to 1 so cold starts should be minimal). There's got to be something else that's causing this - either the number of dependencies or |
Beta Was this translation helpful? Give feedback.
-
For those who are still suffering from this issue, I want to share my experience. My cold start time was about 7 seconds on a new project. Now I can say that:
In any case, when researching this issue, I found many similar issues that are still unresolved, and I couldn't find any comments from Vercel. I hope you all will find the solution to this problem. Good luck! Relative: By the way, for some reason, I can't find the relevant documentation for the |
Beta Was this translation helpful? Give feedback.
-
This is the scenario where I use
|
Beta Was this translation helpful? Give feedback.
-
Im having issues with What version of node is everyone use? Were using Apollo query so not sure experimental-edge is any switch for us |
Beta Was this translation helpful? Give feedback.
-
Same here. |
Beta Was this translation helpful? Give feedback.
-
any updates on this? Vercel is a great service but for those not able to use Edge for the time being I wonder what options we have here. Since this only happens the first time, it must be a cold start issue right? Question is if its related to loading nodejs or just the app. For subscribing Vercel users it would be nice to get some feedback on what is really causing the delay even if it will not be fixed. Could this be solved with a different hosting plan? Is there an easy way, maybe a built in feature to keep the app warm? Thanks in advance for any feedback. |
Beta Was this translation helpful? Give feedback.
-
pls any solution? this is unusable |
Beta Was this translation helpful? Give feedback.
-
We are facing this issue too. Looking at using the edge runtime but that would require us to rearchitect our app a bit. Hope a fix is prioritized. |
Beta Was this translation helpful? Give feedback.
-
my solution was to leave vercel and move to amplify, no issues since.
…On Sat, 20 Jan 2024 at 13:14, patched-admin ***@***.***> wrote:
We are facing this issue too. Looking at using the edge runtime but that
would require us to rearchitect our app a bit. Hope a fix is prioritized.
—
Reply to this email directly, view it on GitHub
<#12447 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA6B5XOUADOVSA7GP7HT7NLYPOYKPAVCNFSM4MYG7AXKU5DIOJSWCZC7NNSXTOKENFZWG5LTONUW63SDN5WW2ZLOOQ5TQMJYHE4DMOA>
.
You are receiving this because you commented.Message ID: <vercel/next.
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
In my case, it was making my /blog page very slow, as I'm getting posts from an API, and I wanted to use serverSideProps for SEO, but when people already navigated the main page, or any other page, I get the posts using useEffect instead, and it was still taking ages to load. I did a little, and bizarre hack to prevent this (which doesn't totally fix it, but it makes it unnoticeable).
export default function Preload(){
return null;
}
export const getServerSideProps = () => {
return {
props: {
empty: true
},
};
}; and then anywhere in your layout: useEffect(() => {
fetch("/blog/preload");
}, []); |
Beta Was this translation helpful? Give feedback.
-
any solution? 😡 |
Beta Was this translation helpful? Give feedback.
-
This is still the solve for me it uses the old API but solves the issue. Hoping this gets addressed |
Beta Was this translation helpful? Give feedback.
-
using next js 14+ same issues... planning to switch to remix js... 😭 |
Beta Was this translation helpful? Give feedback.
-
I had to migrate my project to the app folder, this only solved my problem 🤡 |
Beta Was this translation helpful? Give feedback.
-
Hi all,
I was just hoping to check if things are working normally or if I've done something wrong. It seems like the first call to
getServerSideProps
takes around 2 seconds when running Next in production mode.I have two pages, Home and Test, and a
<Link>
from Home to Test.Test contains the following code:
Why might
getServerSideProps
take so long to run first time?Furthermore - the Test page loads almost immediately the second time I navigate to it, so I'm wondering if there's some way to warm whatever cache is providing the speedup?
Beta Was this translation helpful? Give feedback.
All reactions