Next-auth: Could not find a declaration file for module 'next-auth/client'

Created on 5 Jun 2020  路  2Comments  路  Source: nextauthjs/next-auth

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?

question

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'; to index.d.ts and it should work.

All 2 comments

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dmi3y picture dmi3y  路  3Comments

jimmiejackson414 picture jimmiejackson414  路  3Comments

alephart picture alephart  路  3Comments

ryanbahan picture ryanbahan  路  3Comments

iaincollins picture iaincollins  路  3Comments