Hebilicious / authjs-nuxt

AuthJS edge-compatible authentication Nuxt module.
https://authjs-nuxt.pages.dev/
MIT License
249 stars 28 forks source link

eslint error : NuxtAuthHandler not found in '#auth' #78

Open kouts opened 1 year ago

kouts commented 1 year ago

Environment

Nuxt 3.6.5 Node v18.12.1

Reproduction

N/A

Describe the bug

Thank you for creating this library. I have followed the instructions and added @hebilicious/authjs-nuxt to nuxt.config.ts modules. I've run npm i and npm run dev but I get this error in [...].ts NuxtAuthHandler not found in '#auth'

Additional context

No response

Logs

No response

Hebilicious commented 1 year ago

There is something wrong with your setup, please provide a reproduction.

kouts commented 1 year ago

Here's a Stackblitz with a reproduction, it's basically a default Nuxt 3 install + ESLint and Nuxt AuthJS. You can run npm run lint in the terminal to see the error. Let me know if I missed something. https://stackblitz.com/edit/nuxt-starter-kegoat?file=server%2Fapi%2Fauth%2F%5B...%5D.ts

SCR-20230816-kjrf
Hebilicious commented 1 year ago

This looks like an eslint error due to your eslint configuration. You can check your .nuxt/types/auth.d.ts to see the generated types. You should be able to follow them with your IDE (won't work on stackblitz)

kouts commented 1 year ago

Thanks for the pointers @Hebilicious , I'll look into it.

kouts commented 1 year ago

I looked into it a bit more and it seems that the error gets reported even with the default nuxt eslint plugin. Anyway, feel free to close this issue, but I think it would be useful for others to know in case they bump into it.