ReferenceError: process is not defined (Cloudflare + Sveltekit)
Using BetterAuth in connection with Cloudflare and Sveltekit, brings following error: ReferenceError: process is not defined
This internal error only appears in the deployed Version on Cloudflare and not the local one. Most likely duo using imports like for example the filesystem (fs) which is not nativly supported in Cloudflare.
20 Replies
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
Will try that later, but would prefer if we could find a solution where we nativly integrate it without the flag since it nodejs_compat (never tested nodejs_compat_v2) increased my bundle size a lot :/
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
Would something speak against using import.meta.env in combination/instead of process.env? Did not really look into the BetterAuth source but if it uses vite it should work?
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
tsup? Is that something new?
I think for the Project BetterAuth it would be the best to find a solution that makes it work with Cloudflare without to much additional Configuration. I will also look a bit into tsup if there is something similiar to the import meta in vitest
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
eww esbuild
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
Vite 6 no more
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
Yeah, but the vision they have is crazy with v0
Do you know why tsup is rather used than vite, is that a preference thing?
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
Fair, but there is no known equivalent like import.meta for tsup?
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
🥲
could you try the next release
pnpm i better-auth@next
and let me know if it's fixedYour fast, will do.
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
Solved
But pls, don't get a burnout like Pilcrow with Lucia
the speed you push those Updates are inhuman crazy