500 error upon deployment of a Supabase subscription to Cloudflare Pages
See original GitHub issueBug report
Describe the bug
I have a SvelteKit app that uses the ‘@sveltejs/adapter-cloudflare’ adapter to deploy to Cloudflare Pages.
The app uses the @supabase/supabase-js library to connect to my Supabase project. I’ve deployed an app with data reading & writing successfully to Supabase.
I’ve added a basic supabase subscription, and having deployed the change I get the following error on page load:
500 Cannot assign to read only property ‘stack’ of object ‘’ TypeError: Cannot assign to read only property ‘stack’ of object ‘’
The subscription works correctly in local development, but fails when deployed.
Here is the code snippet that causes the failure:
const steps = readable(null, (set) => {
supabase
.from('steps')
.select('*')
.order('created_at')
.then(({error, data}) => set(data))
/* Code above here deploys successfully. Code below does not. */
const subscrption = supabase
.from('steps')
.on('*', (payload) => {
if (payload.eventType === 'INSERT') {
set([...get(steps), payload.new])
}
})
.subscribe()
return () => supabase.removeSubscription(subscrption)
})
System information
- OS: Windows
- Browser (if applies): Chrome
- Version of supabase-js: 1.35.4
- Version of Node.js: 16
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
500 error when deploying SvelteKit app to pages
When deploying my SvelteKit app to Cloudflare Pages, it builds without issue but navigating to the site shows my navbar and footer, ...
Read more >Community Tip - Fixing Error 500: Internal Server Error
My site stops working when I enable cloudflare? 500 Errors. Community Tip - All Published Tips. Error 500 & White blank page just...
Read more >Getting 500 error when trying to buy page rules - Billing
I tried to buy more page rules but I get an error warning that reads: Status: 500, message: failed calling backend for creting...
Read more >Site gets internal server error 500 message - DNS & Network
hi, one of my site that has been working fine for a long time suddenly get a 500 internal server error message, when...
Read more >500 Internal Server Error for all CF sites - #43 by KianNH
Hi community. I am getting 520 error while loading my site… usually when using a VPN to access it from another country. Anyone...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@craigdrayton gotcha, i’ll close this issue for now but feel free to re-open if you’re hunch regarding CF adapter doesn’t work out.
Well color me confused, when I do nothing other than add a try/catch block around the subscription, the 500 error stops occurring, but also the subscription works!?