Nuxt Typescript - fetchOnServer does not exist in type...
chrissyast opened this issue · comments
chrissyast commented
- I have searched through existing issues
- I have read through docs
- I have read FAQ
- I have tried restarting VS Code or running
Vetur: Restart VLS
Info
- Platform: Win 10
- Vetur version: v0.35.0
- VS Code version: 1.67.2
Problem
No error in VLS
In editor:
(property) fetchOnServer: boolean
No overload matches this call.
The last overload gave the following error.
Argument of type '{ fetchOnServer: boolean; data(this: Readonly<Record<never, any>> & Vue): any; }' is not assignable to parameter of type 'ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<DefaultProps>, DefaultProps>'.
Object literal may only specify known properties, and 'fetchOnServer' does not exist in type 'ComponentOptions<Vue, DefaultData<Vue>, DefaultMethods<Vue>, DefaultComputed, PropsDefinition<DefaultProps>, DefaultProps>'.
Vetur(2769)
However, fetchOnServer
is a valid nuxt property https://nuxtjs.org/docs/components-glossary/fetch/#options
Reproducible Case
https://github.com/chrissyast/fetchOnServerBug
Open in VSCode with Vetur extension
npm install
npm run dev
Open pages/index.vue