-
-
Notifications
You must be signed in to change notification settings - Fork 310
Open
Labels
bug 🔥Broken or incorrect behavior.Broken or incorrect behavior.
Description
Nuxt's useFetch accepts watch?: MultiWatchSources | false (docs), which is the idiomatic way to disable auto-refetching on reactive param changes.
However, asyncDataOptions is typed as AsyncDataOptions<...> (from nuxt/app), which only has watch?: MultiWatchSources — missing | false. Passing watch: false produces:
Type 'boolean' is not assignable to type '(object | WatchSource<unknown>)[]'
This is because the | false variant lives on Nuxt's UseFetchOptions type but not on AsyncDataOptions, and hey-api uses the latter.
Suggested fix: Extend the type to accept false:
asyncDataOptions?: AsyncDataOptions<...> & { watch?: false };Workaround: watch: [] compiles and has the same runtime effect, but is less idiomatic.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug 🔥Broken or incorrect behavior.Broken or incorrect behavior.