Delay Loading Page on Vercel
This isn't something I notice when I'm running in development mode. But when we deploy to Vercel, the first time we load the app, or any time we try to refresh (so I guess any time it goes to the server for a route), we get a 10 second delay before everything rushes in.
I'm struggling to debug it because I don't really get any logs. I've got a suspicion it could be to do with Clerk because there is a route that is not authenticated, and I don't think it's having the same issue, but it also doesn't do a lot. There's nothing in the browser recording of the requests because it's all in the single request to that route, not in any of the server function calls. the browser just sort of sits on a white page for 10 seconds and then everything rushes in as it does the extra calls.
Has anyone experienced anything like this or have any sort of suggestions on where I could start to look?
10 Replies
spiritual-aqua•6h ago
did you configure a 10 sec timeout anywhere? or could it be the default for clerk?
cc @wobsoriano
try building locally for node server and see if it happens as well
relaxed-coralOP•5h ago
There's nothing I can see with a 10 sec timeout. I'm not seeing anythign fail either, it just seems to hang and then completes just fine, but after the wait. It's quite odd.
That's a good idea, i'll try that now.
I removed the vercel target so I could run it locally and I don't see the same issue from the prod build. Only difference I guess is dev vs prod clerk as I can't talk to production from localhost I need to use the dev instance. I would hope they are the same.
spiritual-aqua•5h ago
why cant you use prod clerk locally?
relaxed-coralOP•5h ago
Clerk: Production Keys are only allowed for domain "xxx"
adverse-sapphire•5h ago
hey Im on paternal leave 😅 , if you think this is a Clerk issue feel free to join our Discord and open a support thread there!
Also, are you running on RC version of tanstack start?
relaxed-coralOP•5h ago
Congratulations! Ok, will do.
Yes I think I am, it's quite recently I updated it all
adverse-sapphire•5h ago
And you are using the snapshot version of
@clerk/tanstack-react-start
right? Since the current one only works on pre-RC of tanstackrelaxed-coralOP•5h ago
"@tanstack/react-start": "^1.131.28"
"@clerk/tanstack-react-start": "^0.23.1"
So it does look like I'm a little behind
adverse-sapphire•5h ago
yeah okay so try to update your tanstack dependencies, and use this version of Clerk tanstack https://github.com/clerk/javascript/pull/6859
relaxed-coralOP•5h ago
I'll give that a go, thank you!