Vite cannot find "react" import in the npm package
I'm implementing the svelte demo in my sveltekit app as a test, and when running vite server, this error occurs:
Running Node v23
Solution:Jump to solution
Solved: The initial import of the library in the client was using "better-auth/react", needed to change it to "better-auth/svelte" to import the correct framework library.
3 Replies
the svelte kit app needs a serious clean up 👀 I'd suggest just following the guide in the docs for the time being
I cleaned it significantly, but I’ll just give that a shot instead.
Solution
Solved: The initial import of the library in the client was using "better-auth/react", needed to change it to "better-auth/svelte" to import the correct framework library.