I've been dealing with a bizarre bug that I'm struggling to figure out. My React single-page application (SPA) is built with Vite and deployed on Vercel, utilizing Supabase for authentication and database management. Recently, I noticed my iPhone heating up while using the app and discovered over 4000 GET requests to the root URL ('/') within a short timeframe through Vercel's analytics. The strange part is I was on a different page ('/app') during this spike.
After hours of troubleshooting, I've ruled out infinite loop issues since my useEffects seem fine. Supabase logs indicate normal activity, and I have no service workers or polling setup in my code. Interestingly, my browser's Network tab shows nothing unusual when this happens.
Diving into the Vercel logs, I noticed that a large number of these requests had "No Referrer" and originated from an Akamai IP address, not my home WiFi. The cache hit rate was extremely high, indicating repeated requests for the same content. This odd behavior only occurs on mobile Safari, and it's quite unpredictable—sometimes appearing in private browsing mode and sometimes not. My current suspicion is around the u/vercel analytics tool possibly being the culprit, as these requests seem to stem from a CDN or monitoring rather than direct browser activity. I'm testing by temporarily disabling SpeedInsights. If anyone has encountered a similar issue or has insights on what might be causing this flood of requests related to mobile Safari, I'd greatly appreciate it!
4 Answers
It kind of sounds like a JavaScript bug, possibly an infinite request loop. Have you thoroughly checked your code, especially around the areas where you manage your network requests?
I haven't worked with the tools you're using, but a debugging strategy I've found useful is to duplicate your project and gradually remove sections until you identify the issue. It can be labor-intensive, especially with hard-to-reproduce bugs, but it might help you track down the root cause.
Could you share your repository? Maybe the community could help identify any issues in your code or setup.
Have you considered that this might be caused by bots or automated scripts? Maybe they're triggering the requests while you're on the site, but the activity could be from something else.
I thought about bots too, but I've only encountered this issue while I'm using the app. If it was a bot, wouldn't it show up even when I'm not using it?

That's what I initially suspected. But my investigation didn't show anything off, and the bug is super inconsistent, so it’s tough to pinpoint.