BA
Better Auth•5mo ago
Jumaron

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
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
Jumaron
JumaronOP•5mo ago
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
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
Jumaron
JumaronOP•5mo ago
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
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
Jumaron
JumaronOP•5mo ago
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
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
Jumaron
JumaronOP•5mo ago
eww esbuild
Unknown User
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
Jumaron
JumaronOP•5mo ago
Vite 6 no more
Unknown User
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
Jumaron
JumaronOP•5mo ago
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
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
Jumaron
JumaronOP•5mo ago
Fair, but there is no known equivalent like import.meta for tsup?
Unknown User
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
Jumaron
JumaronOP•5mo ago
🥲
bekacru
bekacru•5mo ago
could you try the next release pnpm i better-auth@next and let me know if it's fixed
Jumaron
JumaronOP•5mo ago
Your fast, will do.
Unknown User
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
Jumaron
JumaronOP•5mo ago
Solved But pls, don't get a burnout like Pilcrow with Lucia the speed you push those Updates are inhuman crazy

Did you find this page helpful?