Nothing much actually.
Inside a Typescript environment, "$config" type doesn't exist inside the Context parameter.
Context interface should expect a "$config" field
Type Error
For people interested in a workaround :
declare module 'vue/types/vue' {
interface Vue {
$config: any
}
}
declare module '@nuxt/types' {
interface Context {
$config: any
}
}
Hi @WTDuck. Types are provided i think you just need to add @nuxt/[email protected] (the one shipped with @nuxt/typescript is0.x and will be removed soon).
Please reopen if upgrading didn't resolve the issue.
Bonjour @pi0 !
I believe you got me wrong.
NuxtJS package already provides type definition for TypeScript and it's awesome (aka @nuxt/types)
I'm just pointing a missing key inside those definitions about the new context feature : $config
export interface Context {
app: NuxtAppOptions
base: string
...
// missing $config
}
Related issue : https://github.com/nuxt/typescript/issues/386
@pi0

I guess, you need to update @nuxt/typescript-build package with updated @nuxt/types package.
Most helpful comment
@pi0
I guess, you need to update
@nuxt/typescript-buildpackage with updated@nuxt/typespackage.