Error on SvelteKit app deployed to Cloudflare Pages

My SvelteKit application broadcasts messages via Supabase Realtime on the server side (docs for reference).
A server error happens precisely during this step, unfortunately the Supabase-js library doesn’t provide detailed error messages for this, all I’m getting is a string that is either error or ok, so I can’t say exactly what the error is.

It works perfectly fine when running my app locally, and the strange thing is it also works fine when I deploy my app manually using wrangler or the Cloudflare dashboard.
The problem only seem to arise on automated deployments via cloudflare/pages-action@v1.

GitHub Actions remains my preferred method of deployment so I would really like to find a solution to this, unfortunately I have been breaking my head over this for days and cannot seem to figure it out.

I will gladly provide more information if necessary.