"This Edge Function has Crashed" - intermittent errors

We’ve been getting this intermittent error shown to users (ecommerce website) for a year now - it doesn’t happen often which is why we haven’t looked into it. We’re also not sure why it’s caused. The edge function logs show the following errors:
Oct 24, 12:31:57 PM: error Uncaught (in promise) resource closed
Oct 23, 01:21:58 PM: 01JAWN77 error Unable to render error page
Oct 23, 01:21:58 PM: 01JAWN77 error resource closed

Note that the first line " error Uncaught (in promise) resource closed" appears about 15-20 times but I removed the duplicates. I do see it every time the error “This edge function has crashed” occurs.

The “unable to render error page” is seen less often. There are also other less frequent errors like:

Oct 23, 07:25:06 PM: 01JAXA05 error BadResource: Bad resource IDOct 23, 07:25:06 PM: 01JAXA05 error at Object.pull (ext:deno_web/06_streams.js:946:38)Oct 23, 07:25:06 PM: 01JAXA05 error at Module.invokeCallbackFunction (ext:deno_webidl/00_webidl.js:981:16)Oct 23, 07:25:06 PM: 01JAXA05 error at ReadableByteStreamController.pullAlgorithm (ext:deno_web/06_streams.js:3563:14)Oct 23, 07:25:06 PM: 01JAXA05 error at readableByteStreamControllerCallPullIfNeeded (ext:deno_web/06_streams.js:1242:49)Oct 23, 07:25:06 PM: 01JAXA05 error at ReadableByteStreamController.[[[PullSteps]]] (ext:deno_web/06_streams.js:5990:5)Oct 23, 07:25:06 PM: 01JAXA05 error at readableStreamDefaultReaderRead (ext:deno_web/06_streams.js:2513:36)Oct 23, 07:25:06 PM: 01JAXA05 error at ext:deno_web/06_streams.js:2742:9Oct 23, 07:25:06 PM: 01JAXA05 error at new Promise ()Oct 23, 07:25:06 PM: 01JAXA05 error at ext:deno_web/06_streams.js:2741:14Oct 23, 07:25:06 PM: 01JAXA05 error at eventLoopTick (ext:core/01_core.js:168:7) {Oct 23, 07:25:06 PM: 01JAXA05 error name: "BadResource"Oct 23, 07:25:06 PM: 01JAXA05 error }Oct 23, 07:56:21 PM: 01JAXBSB error Unable to render error pageOct 23, 07:56:21 PM: 01JAXBSB error resource closed

I realise I may be reporting multiple issues here - the common theme is: I have not idea where the error is or what’s causing it.

One thing I noticed is that requests that may take longer than a few seconds may result in the most frequent error which is “error Uncaught (in promise) resource closed” but I might be wrong.

Any idea where I should start to look?

Thanks

Potentially related: Netlify Status - Increased errors and latencies across the network

This is likely related.
But I do get this issue at least once a day. Is it a memory allocation issue?
Is there a way for me to know if bandwidth or machine allocation is the issue and find a way to resolve this?
We’re seriously considering migrating off of Netlify to Firebase App hosting which we had a more positive experience with for years. easy of use and maintenance of Netlify are great pluses - but this shouldn’t come at the cost of reliability.

It would be hard to say without looking a specific request outside of the incident’s time. What do you see in the logs when this happens?

We see “error Uncaught (in promise) resource closed”. If the error doesn’t ring a bell for a known root cause let me know - we can dig in more to find the culprit. The generic error message doesn’t help but I believe I can replicate this when I try to reload certain pages which do server-side API calls.

Just looking at 1 day of logs, I see the following error more than 100 times throughout the day:
Oct 30, 02:54:15 PM: error Uncaught (in promise) resource closed

Any idea where I should be looking to get more details about the error?
The app is a QwikJS app - with the server side doing (not-very-frequent) calls to a an API to fetch data.

Do you recommend that we move away from edge functions to better understand the issue? it seems like other face this with Deno (other issues, different platforms and hosting solutions.)

Can you share the site name OR URL so we can check?