authjs-nuxt icon indicating copy to clipboard operation
authjs-nuxt copied to clipboard

eslint error : NuxtAuthHandler not found in '#auth'

Open kouts opened this issue 2 years ago • 5 comments

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

kouts avatar Aug 14 '23 16:08 kouts

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

Hebilicious avatar Aug 16 '23 06:08 Hebilicious

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

kouts avatar Aug 16 '23 08:08 kouts

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)

Hebilicious avatar Aug 16 '23 13:08 Hebilicious

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

kouts avatar Aug 16 '23 14:08 kouts

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.

kouts avatar Aug 16 '23 16:08 kouts