Nextjs app wont load 50% of the time

I have a nextjs app and 40-50%it will load without problems and other times (50-60%) it wont load for at least 30 seconds up to 1 minute or more. When it takes that long to load I see a ‘connection to this site is not secure’. What could be the reason?


I’ve replied to the ticket you also opened. Let’s keep the conversation in one place (on the ticket).

I’ll repeat my response here:

It sounds like you’re describing the behavior of free instance types. They will spin down after 15 minutes of inactivity and spin back up with a subsequent request - which can take a little time. This is noted in the docs:

And on the service dashboard:

Free instance types will spin down with inactivity. Upgrade to a paid instance type to prevent this behavior.

In addition, with NextJs apps, we sometimes see the start process open multiple ports, which can cause issues. To be sure you’re not affected by that particular issue, please define a PORT env var manually (10000 is our default value).


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.