framework icon indicating copy to clipboard operation
framework copied to clipboard

RC.13 module config: Type 'import(".../@nuxt/schema/dist/index").ModuleOptions' is not assignable to type 'ModuleOptions'

Open BracketJohn opened this issue 3 years ago • 1 comments

Environment

  • Operating System: Darwin
  • Node Version: v16.14.2
  • Nuxt Version: 3.0.0-rc.13
  • Nitro Version: 0.6.1
  • Package Manager: [email protected]
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

Checkout this PR: https://github.com/sidebase/nuxt-auth/pull/22

The upgrade to rc.13 was done via npx nuxi@latest upgrade --force

Describe the bug

After upgraging to nuxt rc.13, when type-checking the nuxt-auth module we get:

❯ npm run types

> @sidebase/[email protected] types
> tsc --noEmit

playground/nuxt.config.ts:4:13 - error TS2322: Type 'NuxtModule<ModuleOptions>' is not assignable to type 'string | NuxtModule<ModuleOptions> | [(string | NuxtModule<ModuleOptions> | undefined)?, ({ [x: string]: any; } | undefined)?] | undefined'.
  Type 'import("~/repos/sidebase/nuxt-auth/node_modules/@nuxt/schema/dist/index").NuxtModule<ModuleOptions>' is not assignable to type 'import("~/repos/sidebase/nuxt-auth/node_modules/@nuxt/schema/dist/index").NuxtModule<import("~/repos/sidebase/nuxt-auth/node_modules/@nuxt/schema/dist/index").ModuleOptions>'.
    Types of property 'getOptions' are incompatible.
      Type '((inlineOptions?: ModuleOptions | undefined, nuxt?: import("~/repos/sidebase/nuxt-auth/node_modules/@nuxt/schema/dist/index").Nuxt | undefined) => Promise<...>) | undefined' is not assignable to type '((inlineOptions?: import("~/repos/sidebase/nuxt-auth/node_modules/@nuxt/schema/dist/index").ModuleOptions | undefined, nuxt?: import("~/repos/sidebase/nuxt-auth/node_modules/@nuxt/schema/dist/index").Nuxt | undefined) => Promise<...>) | undefined'.
        Type '(inlineOptions?: ModuleOptions | undefined, nuxt?: import("~/repos/sidebase/nuxt-auth/node_modules/@nuxt/schema/dist/index").Nuxt | undefined) => Promise<...>' is not assignable to type '(inlineOptions?: import("~/repos/sidebase/nuxt-auth/node_modules/@nuxt/schema/dist/index").ModuleOptions | undefined, nuxt?: import("~/repos/sidebase/nuxt-auth/node_modules/@nuxt/schema/dist/index").Nuxt | undefined) => Promise<...>'.
          Types of parameters 'inlineOptions' and 'inlineOptions' are incompatible.
            Type 'import("~/repos/sidebase/nuxt-auth/node_modules/@nuxt/schema/dist/index").ModuleOptions | undefined' is not assignable to type 'ModuleOptions | undefined'.
              Type 'import("~/repos/sidebase/nuxt-auth/node_modules/@nuxt/schema/dist/index").ModuleOptions' is not assignable to type 'ModuleOptions'.

4   modules: [NuxtAuth],

Ts seems to hand itself up with the "not quite" sameness of ModuleOptions in the last line:

 Type 'import("~/repos/sidebase/nuxt-auth/node_modules/@nuxt/schema/dist/index").ModuleOptions' is not assignable to type 'ModuleOptions'

maybe this is related to making TS stricter in RC13?

Additional context

No response

Logs

No response

BracketJohn avatar Nov 12 '22 11:11 BracketJohn