Closed NiklasPor closed 10 months ago
I've reported this to the team and we will get a fix out soon.
This seems to be broken again with the latest release.
@arxpoetica can you provide some steps to reproduce this please? or provide a minimal reproducible example repo.
Hey, yes—might not come back to it for a while, but I will.
@arxpoetica can you provide some steps to reproduce this please? or provide a minimal reproducible example repo.
Works with Vite 4: https://stackblitz.com/edit/sveltejs-kit-template-default-tnrxgs?file=package.json Doesn't work with Vite 5: https://stackblitz.com/edit/sveltejs-kit-template-default-8hs1lt?file=package.json
Steps to repro:
npm i -D @supabase/supabase-js
npm run dev
@supabase/supabase-js
and get error when the client hydrates.I think there's something deeper here to figure out related to how Vite 5 handles file vs. Vite 4 - I'm not sure if this is a Vite bug, or a SvelteKit bug, or a Supabase bug. For reference, in Vite 4, @supabse/node-fetch loads a browser version client-side:
But in Vite 5 it loads the server version on the client:
Circling back, just wanted to update that there is no bug when using Vite 5 with SvelteKit 2 which also uses @sveltejs/vite-plugin-svelte v3 - https://stackblitz.com/edit/sveltejs-kit-template-default-x9ybq2?file=package.json
I've got this issue with sveltekit 2 and vite 5
I ran into this bug following Creating a Supabase client for SSR | Supabase Docs.
@supabase/ssr 0.0.10 @supabase/supabase-js 2.32.0 @supabase/node-fetch 2.6.15
I've got this issue with supabase using sveltekit 2 and vite 5.
In my case, it was possible to fix it by updating PNPM to the latest version (v8.15.3).
After that, I deleted the pnpm-lock.yaml
file, the .svelte-kit
and node_modules
folders and ran pnpm install
and everything worked.
I've got this issue with supabase using sveltekit 2 and vite 5. In my case, it was possible to fix it by updating PNPM to the latest version (v8.15.3). After that, I deleted the
pnpm-lock.yaml
file, the.svelte-kit
andnode_modules
folders and ranpnpm install
and everything worked.
Had exactly the same condition as you, and this solution worked. Thank you so much!!!
I've got this issue with supabase using sveltekit 2 and vite 5. In my case, it was possible to fix it by updating PNPM to the latest version (v8.15.3). After that, I deleted the
pnpm-lock.yaml
file, the.svelte-kit
andnode_modules
folders and ranpnpm install
and everything worked.
If you are generating project using npm create svelte@latest my-app
, remember to run pnpm update
I ran into this bug following Creating a Supabase client for SSR | Supabase Docs.
@supabase/ssr 0.0.10 @supabase/supabase-js 2.32.0 @supabase/node-fetch 2.6.15
Were you able to resolve it?
Bug report
Describe the bug
After installing the latest dependencies (upgrading to version
1.8.1
of this package), browser builds (plain react app), start breaking because global is undefined. This is a classic error when node modules, in this case@supabase/node-fetch
, are imported in a browser context.The errors are thrown from this file: ../node_modules/.pnpm/@supabase+node-fetch@2.6.13/node_modules/@supabase/node-fetch/lib/index.mjs
Expected behavior
Not breaking
Workaround
Pin your
@supabase/postgrest-js
version to1.8.0
.E.g. with pnpm:
Screenshots
System information
2.33.1
18.16.0
Additional context