nuxt-appconfig-input-repro

Reproduction for nuxt/nuxt#36128: user AppConfigInput augmentation on nuxt/schema breaks module augmentations on @nuxt/schema

0
0
0
TypeScript
public

nuxt-appconfig-input-repro

Reproduction for nuxt/nuxt#36128, originally reported in nuxt/ui#6791. No @nuxt/ui involved.

modules/theme.ts does what any module typing its app config key does: sets a runtime default and augments @nuxt/schema with an optional theme? on AppConfigInput and a required resolved theme on CustomAppConfig.

app/index.d.ts augments AppConfigInput on nuxt/schema as recommended by the docs.

Steps

pnpm install
pnpm typecheck
app/app.config.ts(1,32): error TS2345: Argument of type '{}' is not assignable to parameter of type 'AppConfigInput'.
  Property 'theme' is missing in type '{}' but required in type 'AppConfigInput'.

Delete app/index.d.ts and typecheck passes, theme is optional again.

With nuxt/nuxt#36128 applied to node_modules/nuxt/schema.d.ts, typecheck passes with app/index.d.ts in place.

v0.3.3[beta]