Debugging SSR Page

What is the best way to debug a 1101 Error and tail says Error: The script will never return a response. For context we are hosting an astro site with SSR as a "sandbox" environment for customers to test CMS changes before deploying (the final page is static). But for some "some minutes - minutes could also last for 20-25 minutes" the page works perfeclty fine and then for a long time there is the 1101 Error and I really cant find a way to debug, etc. Any help / direction would be really appreciated. moved from #Debugging SSR Page
23 Replies
F0rce
F0rceOP10mo ago
bump New thing happening today, we have no code changes, we only changed the name of an css class and the deployments (direct upload via ci/cd) start failing without any reason Just for reference if you want to "reproduce" the error by yourself, go onto https://murtleontour.ruxiom.dev and spam the reload button (after at least 5 times, you will receive the above error) there is actually no debugging possible from our end :/
Chaika
Chaika10mo ago
That error usually means you're doing things in the global scope i.e starting a promise on request A and waiting on request B. It doesn't see the promise from another request / thinks you're deadlocked and dies. Only possible by mishandling stuff in the global scope
F0rce
F0rceOP10mo ago
as I am using Astro and the cloudflare adapter I would not know where to start. We are using Storyblok as an cms and the only "fetch" that is done is on page load which is completely error handeled: [...slug].astro
let story;
try {
const { data } = await storyblokApi.get(
`cdn/stories/${slug === undefined ? "startseite" : slug}`,
{
version:
import.meta.env.PUBLIC_ENV === "production" ? "published" : "draft",
resolve_links: "url",
}
);

story = data.story;
} catch (error) {
throw new Error(toErrorWithMessage(error).message);
}
let story;
try {
const { data } = await storyblokApi.get(
`cdn/stories/${slug === undefined ? "startseite" : slug}`,
{
version:
import.meta.env.PUBLIC_ENV === "production" ? "published" : "draft",
resolve_links: "url",
}
);

story = data.story;
} catch (error) {
throw new Error(toErrorWithMessage(error).message);
}
I'm really trying to find where to start. I could obviously try to optimize the js even more, but if it is not the problem (and astro's whole "doing" is less js) I would rather try working on something else
Chaika
Chaika10mo ago
GitHub
Erron when hosting in Cloudflare with Server Side Rendering enabled...
What version of astro are you using? 2.7.4 Are you using an SSR adapter? If so, which one? Cloudflare What package manager are you using? npm What operating system are you using? Mac What browser a...
Chaika
Chaika10mo ago
GitHub
Storyblok client throttling crashing Astro adapter in CloudFlare Wo...
I have a project using Astro. Astro has a CloudFlare Worker "adapter" for doing server side rendering (SSR). This will re-render the preview page every time someone hits "save" ...
Chaika
Chaika10mo ago
looks like there's a hotpatch there as well
F0rce
F0rceOP10mo ago
wow. you really helped me out so much. really appreciate it. I was doing my research aswell but I didnt find any issue related to that... maybe blindeyed, so thanks. But could this also be the reason for the deployments just not "deploying" ? (pun intended)
Chaika
Chaika10mo ago
what's the error you get with that? You're using wrangler direct upload and they just show up as failed in the dash, or?
F0rce
F0rceOP10mo ago
just shows up as failed in the dash direct upload goes through perfectly fine and also returns an preview url (which does not work) the webhook for page deployments warns me that it didnt work
Chaika
Chaika10mo ago
Your function is too large/fails to startup/etc. I would check size and such first, and if needed Pages team can always pull the logs on their side That's a CF bug that makes it not show: https://github.com/cloudflare/workers-sdk/issues/3966 If you were using the github integration it would show the exact error, but for direct upload it just swallows it.
F0rce
F0rceOP10mo ago
I just implemented the hotpatch in the issue you provided me with. I will give it a try uploading again and if it works now, I can ignore it, if it does not work, ill check back and maybe try to reduce bundle size... at least theres something I can do now ty very much ❤️
Chaika
Chaika10mo ago
the limits you're looking for is if it's over 1 MB (free) or 10 MB (paid)
F0rce
F0rceOP10mo ago
(im on paid and the js is not even close to 10mb -> its 1.34mb)
Chaika
Chaika10mo ago
as long as you've got Workers Paid that shouldn't be an issue then, could be startup time though. if it fails randomly like that again just need the deployment id so they can grab the logs for it ?pages-deployment-id
Flare
Flare10mo ago
The Pages deployment ID is a unique build identifier. It's the UUID in the browser bar (for example, a URL would be dash.cloudflare.com/ACCOUNT_ID/pages/view/PROJECT/DEPLOYMENT_ID where the deployment ID looks something like a398d794-7322-4c97-96d9-40b5140a8d9b). This ID can help troubleshoot some issues with Pages builds so if you have a failing build make sure you grab that ID for the Pages team to use.
F0rce
F0rceOP10mo ago
e36638e3-145b-4ff4-b0b9-b55a5ab79062 this is the build identifier (this included the patch for the storyblok api client)
22:25:09 [vite] dist/_astro/_sentry-release-injection-file.Q4ljCVQ6.js 0.53 kB │ gzip: 0.32 kB │ map: 0.12 kB
22:25:09 [vite] dist/_astro/page.ddJXbYJU.js 238.71 kB │ gzip: 75.90 kB │ map: 1,211.15 kB
22:25:09 [vite] dist/_astro/hoisted.AKJDl8Iz.js 1,399.44 kB │ gzip: 487.69 kB │ map: 4,106.99 kB
22:25:09 [vite] dist/_astro/_sentry-release-injection-file.Q4ljCVQ6.js 0.53 kB │ gzip: 0.32 kB │ map: 0.12 kB
22:25:09 [vite] dist/_astro/page.ddJXbYJU.js 238.71 kB │ gzip: 75.90 kB │ map: 1,211.15 kB
22:25:09 [vite] dist/_astro/hoisted.AKJDl8Iz.js 1,399.44 kB │ gzip: 487.69 kB │ map: 4,106.99 kB
limits should really (really) not apply here
Chaika
Chaika10mo ago
and that one just failed? What's the pages.dev?
F0rce
F0rceOP10mo ago
https://e36638e3.murtleontour.pages.dev jep that one failied, dash says "failed" but you explained already why this is so
Chaika
Chaika10mo ago
Escalated. We'll see, maybe it's start up time. That issue with it not showing the error has been around for a while sadly, hopefully one day they fix that directly
F0rce
F0rceOP10mo ago
thank you very very much for your help and time, really appreciate it. Really curios what the issue now is. I could try downgrading Astro to try debugging from my end, as I just bumbed a minor version today. JFYI: Astro 4.3.3 broke something, as the deploy works perfectly fine (is live right now) with Astro 4.3.2 I would really like to know the issue tho, as I could make a new issue on astro side.
Chaika
Chaika10mo ago
Uncaught TypeError: Cannot read properties of undefined (reading 'href') at bundledWorker-0.4617897147329113.mjs:6119:29 in afterAllSetup
Uncaught TypeError: Cannot read properties of undefined (reading 'href') at bundledWorker-0.4617897147329113.mjs:6119:29 in afterAllSetup
Did you say it only happened intermittently or was that just about the script never returning a response issues?
F0rce
F0rceOP10mo ago
it happened in two steps (commits). Did change some styling (changed the css) deploy worked, bumped dependencies (only astro) deploy did not work. That was the reason I started this thread again because after the bump of the dependencies the deploy did not work anymore. after reverting the second commit (only reverting the bump) everything works perfectly fine (including the patch for the api client of storyblok)
Matheson
Matheson9mo ago
I only have one server side function and am getting this error I am using NextJS however
Want results from more Discord servers?
Add your server