Brycycle
TTCTheo's Typesafe Cult
•Created by Brycycle on 12/16/2023 in #questions
TypeError: GoogleProvider is not a function when running with .ts script using tsx
converting the file to a
.tsx
produces the same error sadly.6 replies
TTCTheo's Typesafe Cult
•Created by Brycycle on 12/16/2023 in #questions
TypeError: GoogleProvider is not a function when running with .ts script using tsx
I haven't been able to figure out what about the function being defined in
next-auth/providers/google
causes this error. From my understanding ESM supports default exports, which is what the npm package tsx
is able to compile.
https://github.com/privatenumber/tsx#readme6 replies
TTCTheo's Typesafe Cult
•Created by Brycycle on 12/16/2023 in #questions
TypeError: GoogleProvider is not a function when running with .ts script using tsx
This, will throw a different error when directly calling
getServerAuthSession
from a script, but it resolves the TypeError in my actual use case, seen here:
6 replies
TTCTheo's Typesafe Cult
•Created by Brycycle on 12/16/2023 in #questions
TypeError: GoogleProvider is not a function when running with .ts script using tsx
I was able to resolve this issue by writing in the full function definition of
GoogleProvider
defined in next-auth/providers/google
into the ~/server/auth.ts
file, like so.
6 replies