I seem to be getting the following error when importing next-auth:
module "c:/Users/-/PersonalProjects/joba2b/node_modules/next-auth/client"
Could not find a declaration file for module 'next-auth/client'. 'c:/Users/-/PersonalProjects/joba2b/node_modules/next-auth/client.js' implicitly has an 'any' type.
Try `npm install @types/next-auth` if it exists or add a new declaration (.d.ts) file containing `declare module 'next-auth/client';`ts(7016)
I'm on version 2.0.0-beta.61 and I used https://github.com/iaincollins/next-auth-example as a reference. I did find a similar issue from 2 years ago https://github.com/iaincollins/next-auth/issues/35 but I'm pretty sure my imports are correct.
e.g: import { Provider } from "next-auth/client"
Any ideas on how to fix this?
next-auth doesn't provide any typings for Typescript yet that's why you are getting that error. You can add declare module 'next-auth/client'; to index.d.ts and it should work.
works now cheers!
Most helpful comment
next-auth doesn't provide any typings for Typescript yet that's why you are getting that error. You can add
declare module 'next-auth/client';toindex.d.tsand it should work.