You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dev: better-auth/client/plugins fails to resolve when auth is enabled (the better-auth/client alias matches it as a prefix) #565
With auth enabled, void dev aliases better-auth/client (and /react, /vue, /svelte, /solid) to absolute file paths. A string alias in Vite also matches subpaths, so better-auth/client/plugins, where Better Auth's client plugins such as adminClient() live, is rewritten to …/better-auth/dist/client/index.mjs/plugins, which doesn't exist. Any app that passes a Better Auth client plugin to createAuthClient breaks in dev. void build is not affected, because the alias is only added for serve.
Steps to reproduce
Enable auth in void.config.ts: auth: { providers: ['email'] }.
Add better-auth as a dependency (the same version Void uses).
Create a client with a plugin and import it from a page:
A string find matches the exact id and any id that starts with find + '/', replacing the prefix. resolveFile('better-auth/client') is …/dist/client/index.mjs, so better-auth/client/plugins becomes …/dist/client/index.mjs/plugins.
Possible fix
Anchor the patterns so they only match the exact specifier, and pre-resolve client/plugins too if it should avoid the lazy-discovery reload the comment mentions:
Activity
fix(auth): match the dev better-auth client aliases exactly (voidzero…