nuxt-auth
nuxt-auth copied to clipboard
Object literal may only specify known properties, and 'auth' does not exist in type 'InputConfig<NuxtConfig, ConfigLayerMeta>'
Environment
- Operating System: Darwin
- Node Version: v18.14.1
- Nuxt Version: 3.8.0
- CLI Version: 3.10.0
- Nitro Version: 2.8.0
- Package Manager: [email protected]
- Builder: -
- User Config: devtools, typescript, css, postcss, runtimeConfig, modules, auth
- Runtime Modules: @sidebase/[email protected]
- Build Modules: -
Reproduction
https://github.com/victorlmneves/nuxt-auth0
Describe the bug
Argument of type '{ devtools: { enabled: false; }; typescript: { shim: false; }; css: string[]; postcss: { plugins: { autoprefixer: {}; }; }; runtimeConfig: { API_KEY: string | undefined; OPC_APIM_KEY: string | undefined; ... 8 more ...; AUTH0_CLIENT_SECRET: string | undefined; }; modules: string[]; auth: { ...; }; }' is not assignable to parameter of type 'InputConfig<NuxtConfig, ConfigLayerMeta>'. Object literal may only specify known properties, and 'auth' does not exist in type 'InputConfig<NuxtConfig, ConfigLayerMeta>'
Additional context
I'm using Nuxt 3.8.0, @sidebase/nuxt-auth 0.6.2 and next-auth 4.2.1
Logs
No response
Same issue here. Follow the get started steps and adding auth to the nuxt.config.ts gives the same error.
issue still exist on latest version 0.7.0
same issue, there is no version constrains between nuxt-auth and nuxt. the defineNuxtConfig ts has no property named 'auth object', it is simary that, nuxt-v3.6 and nuxt-auth-v6 worked well.
For me reinstalling dependencies worked (even though I've already added module and used nuxi to add module)
npm i
After adding the lines:
auth: {
provider: {
type: "authjs",
trustHost: false,
defaultProvider: "google",
addDefaultCallbackUrl: true,
},
},
to your nuxt.config.ts make sure to install the packages again by running npm i or pnpm i.