KZ
KZ
BABetter Auth
Created by KZ on 4/4/2025 in #bug-reports
webcrypto issue w/ vite6(vs. 5) rr v7 ssr while in cf-wrangler [minflare]
Its not a bug i can point to yet because the likelihood is that its almost certainly vite or the vite config's fault but the following combination and using vite 6 vs vite 5 causes webcrypto not resolving. this causes subtle bugs in better-auth that i didn't pick up on and i thought were related to linked generic oauth issues. ssr step reports this: node_modules/@noble/ciphers/esm/cryptoNode.js (6:77): "webcrypto" is not exported by "vite-browser-external", imported by "node_modules/@noble/ciphers/esm/cryptoNode.js". node_modules/@noble/hashes/esm/cryptoNode.js (11:9): "webcrypto" is not exported by "vite-browser-external", imported by "node_modules/@noble/hashes/esm/cryptoNode.js". then for instance getuserinfo will fail with "webcrypto" is not exported by "__vite-browser-external", imported by "node_modules/@noble/ciphers/esm/cryptoNode.js". not your problem i think but i think you'll get ppl complaining in the future. vite 5.4.17 works fine.
3 replies