500 Error for ~400 previously working Pages deploy...
# pages-help
b
Experiencing a strange issue on Cloudflare Pages: - 09:41pm UTC May 10: started seeing some intermittent downtime on our latest preview branch deployment (production deployment disabled) on one of our repos - 11:18pm UTC May 10: full downtime, never recovered. Note that, during this time period no deployments had been done anywhere close to the time frame. The error we get is a 500 error. I was thinking that there must be some issue with our code, but I reviewed through the deployment history (~475 deployments) and found that nearly all of them stopped working too. With only a small handful from a couple of months back that still worked. So over ~400 preview branch deployments all stopped working at the same time. This is accessing via the pages.dev domain, to ensure there wasn't some domain issue. But the custom domain showed the same. I've tried deleting the entire project and reconnecting it three times since and still get the same results. We're using Sveltekit. Does anyone know what could cause hundreds of previously working deployments to stop working at the same time? The front end has no dependency on the backend to 'work' (i.e. display correctly and not get a 500 error). Thank you.
s
Can you see what the error is?
b
Sure, thanks for your reply. Using the Real-time Logs, the notable parts are: "outcome": "ok", "exceptions": [], "logs": [ { "message": [ "TypeError: Cannot read properties of undefined (reading 'visibilityState')" ], "level": "error", "timestamp": xxxxxxxxxxxxxx }, { "message": [ "TypeError: Cannot read properties of undefined (reading 'visibilityState')" ], "level": "error", "timestamp": xxxxxxxxxxxxxx } "response": { "status": 500 } The status shows ‘ok’ for all the log records.
s
Not sure what's causing it (or why it would suddenly change), but your code is experiencing some kind of error there
Are you relying on anything external that might have changed? Some external fetch, db call, etc.
b
Thanks, it does have a backend but the frontend will still 'work' and display regardless of the backend being functional or not. So quite puzzled.
s
If you search your code, do you get any results for visibilityState?
It might be in a dependency, so you might have to build your site locally and look at the output there
b
If I add this to vscode settings and search, I get 494 results in 146 files. "search.useIgnoreFiles": false, "search.exclude": { "**/node_modules": false } Do you happen to know if anything can change for previously deployed Pages? It's quite confusing why months of previously deployed previews would all stop working as well. I was also thinking that perhaps the packages were updated and there was something incompatible. But I don't think the packages get automatically updated for existing deployments unless I'm mistaken? Was also wondering if it could be Compatibility date (under Functions), just that was never modified manually and doesn't seem like it should effect existing deployments either? When this happened we were trying to debug some fairly minor differences between running locally and deployed. Will look deeper into the dependencies. Thanks for your help, I appreciate it 🙂
s
Nothing should ever change on an existing deployment, no
Thats why I'm thinking it could be something external like a db call or network call that happens when rendering your app, that's broken somehow
b
Yeah I would have thought so too, but the frontend really doesn't require anything at all from the backend in order to display. Thanks for your help, appreciate it.