Open Wr4ngla opened 1 year ago
Same issue.
This is the modified hooks file
import { SvelteKitAuth } from '@auth/sveltekit';
import EmailProvider from '@auth/core/providers/email';
import {
EMAIL_SERVER,
EMAIL_FROM
} from '$env/static/private';
export const handle = SvelteKitAuth({
providers: [
EmailProvider({
server: EMAIL_SERVER,
from: EMAIL_FROM
}),
]
});
Solved the problem
use import EmailProvider from 'next-auth/providers/email';
I guess @auth/core email is still in development???
I'm getting the same error. Tried using import EmailProvider from 'next-auth/providers/email'; but still I get the same issue
also tried to harcode @OrJDev pr changes into my @auth but error persist.
I'm getting the same error. Tried using import EmailProvider from 'next-auth/providers/email'; but still I get the same issue
also tried to harcode @OrJDev pr changes into my @auth but error persist.
that is because you misused my solution
it should be email.js and not email.ts
i also replied to you saying that: https://github.com/nextauthjs/next-auth/pull/6615#discussion_r1096558020
Confirming it works with import { Email } from '@auth/core/providers/email';
be sure to install nodemailer. It is not included in npm @auth/core
Possibly related - 8f0226b#r138256101
Ah, I see this was fixed recently, nevermind. The types are still messed up (e.g. Nodemailer cannot take a server: string) but the import works.
Environment
System: OS: Linux 6.0 Pop!_OS 22.04 LTS CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz Memory: 2.70 GB / 7.60 GB Shell: 5.8.1 - /usr/bin/zsh Binaries: Node: 18.12.1 - /usr/bin/node npm: 9.2.0 - /usr/bin/npm Browsers: Firefox: 108.0
Reproduction URL
https://github.com/nextauthjs/sveltekit-auth-example
Describe the issue
this expression is not callable. Type 'typeof import(".../node_modules/@auth/core/providers/email")' has no call signatures.ts(2349)
--> build error: TypeError: __vite_ssr_import_4__.default.default is not a function at /home/.../src/hooks.server.ts:47:17 at async instantiateModule (file:///home/.../node_modules/vite/dist/node/chunks/dep-5e7f419b.js:52224:9)
How to reproduce
Expected behavior
expected build to complete without errors.