Replies: 1 comment 3 replies
-
Hi @bhvngt, have not used Svelte Kit myself but can you override cross-fetch to use fetch. If it has a webpack config, you can do that via externals as shown here. Also would it help if we upgrade gotrue-js to v3.1.4 of cross-fetch? That would be a simple fix to do. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am using a combination of cloudflare workers and sveltekit along with supabase to build my project. It runs on sveltekit without any issues. However, I hit an issue when running a simple supabase query on cloudflare.
Its showing an error in cross-fetch but shows
require not define
instead ofXMLHttpRequest
error.I have also tried to patch cross-fetch (as mentioned in supabase-cloudflare-example) but no luck there. I have noticed that storage-js uses
3.1.4
of cross-fetch whereas postrest-js and gotrue-js uses3.0.6
of cross-fetch. This makes it difficult to apply the patch.I have also tried to use
kit.vite.resolve.alias {"cross-fetch": "fetch"}
setting within svelte.config.js (based on what was done with webpack as per this discussion. But no luck there.I have raised a bug under supabase-js repo with all the details.
Any help/workaround will be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions