Skip to content

Typescript shows server option doesn't exist for generic form of $fetch #1937

@hecktarzuli

Description

@hecktarzuli

Environment

  • Operating System: Darwin
  • Node Version: v18.15.0
  • Nuxt Version: 3.8.0
  • CLI Version: 3.9.1
  • Nitro Version: 2.7.0
  • Package Manager: yarn@1.22.19
  • Builder: -
  • User Config: app, vite, css, components, imports, modules, nitro, runtimeConfig, postcss, devtools, typescript
  • Runtime Modules: nuxt-vitest@0.10.2, @vueuse/nuxt@10.5.0, @pinia/nuxt@0.4.11, @formkit/nuxt@1.2.2
  • Build Modules: -

Reproduction

  1. In a Nuxt project, use $fetch and pass the server property. Notice typescript doesn't show any problems.
  2. Add a generic to $fetch, notice typescript now says server isn't supported.

Describe the bug

When using the generic form of $fetch, typescript shows server isn't supported but when you remove the generic it is.
image
image

Additional context

Added to this repo via @danielroe advice via discord internal/bugs. I'm sure he probably has more insight but this is all I know.

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtypes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions