BA
Better Auth•5mo ago
Duki

[Better Auth]: Couldn't read your auth config. Error: Cannot find module '$app/paths'

Has anyone else had this issue (see title) when running the npx @better-auth/cli generate cli command on SvelteKit? I can't figure out how to fix this issue.
Solution:
Duki, as mentioned by @KiNFiSH you probably need to remove any import that is called using sveltekit conventions and the run it. that's what I had to do
Jump to solution
4 Replies
KiNFiSH
KiNFiSH•5mo ago
yeah currently we dont support svelte $ file path convention , can you please try using relative path
Solution
chumpo
chumpo•5mo ago
Duki, as mentioned by @KiNFiSH you probably need to remove any import that is called using sveltekit conventions and the run it. that's what I had to do
Duki
DukiOP•5mo ago
Aah I see, that's a bummer 🙈 Got lots of imports to fix then. But thanks for the workaround solution! Are there any plans in including this? Because right now, when I fix my imports I even have to fix the imports in other imported files, just because an other function in that file has an other dependency from yet an other file in $lib or $app. Leading to quite a bit of a rat's tail.
Mini
Mini•5w ago
is there any work on this ? because i am using it in a selfhosted app which will be distributed as docker images i planned to just run migrate inside entrypoint file, but this makes thing more complex hm the env support works fine, idk if it's because sveltekit replaces it with the env in build or it just works found a workaround with dynamic import but it breaks ts support, think 2 config files is the only way

Did you find this page helpful?