-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
auth.js tries to import $env/dynamic/private in SvelteKit frontend #11166
Comments
I have the same issue here. @ssebastianoo Could you add back your reproduction branch? I think you deleted it by accident. Edit: // lib/auth.ts
const providers: Provider[] = [
GitHub,
Credentials({
credentials: { password: { label: "Password", type: "password" } },
authorize(c) {
if (c.password !== "password") return null
return {
id: "test",
name: "Test User",
email: "[email protected]",
}
},
}),
]
export const providerMap = providers.map((provider) => {
if (typeof provider === "function") {
const providerData = provider()
return { id: providerData.id, name: providerData.name }
} else {
return { id: provider.id, name: provider.name }
}
})
export const { handle, signIn, signOut } = SvelteKitAuth({
providers,
pages: {
signIn: "/signin",
},
}) If you now import Fix this by simply not consuming anything from the |
@Conceptiks yeah I deleted the branch forgetting about this issue. Do you still need the branch? I can try to recreate it |
Even if I solved it I'm not gonna close it because this is still a bug that pops up following the official documentation |
Totally agree, this should not be happening. |
that's actually so smart |
Will this ever be fixed ? |
Environment
Reproduction URL
https://github.com/ssebastianoo/SelfStats/blob/authjs-bug/src/routes/signin/%2Bpage.svelte
Describe the issue
When trying to set up a custom sign in page the authjs library for SvelteKit tries, for some reason, to
import { env } from "$env/dynamic/private";
in the client, breaking the whole appHow to reproduce
Add a custom login page following the docs
Expected behavior
$env/dynamic/private
shouldn't be imported on the clientThe text was updated successfully, but these errors were encountered: