Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$fetch typings clash with contents of dist folder #15415

Closed
GerryWilko opened this issue Nov 9, 2022 · 0 comments · Fixed by nuxt/framework#8848
Closed

$fetch typings clash with contents of dist folder #15415

GerryWilko opened this issue Nov 9, 2022 · 0 comments · Fixed by nuxt/framework#8848

Comments

@GerryWilko
Copy link

Environment

  • Operating System: Darwin
  • Node Version: v16.17.0
  • Nuxt Version: 3.0.0-rc.13
  • Nitro Version: 0.6.1
  • Package Manager: npm@8.15.0
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://github.com/GerryWilko/nuxt-fetch-typing-issue

Describe the bug

I have identified an issue with the typings on $fetch where the types clash with the contents of the dist folder if you have run npm run generate.

Using the repo attached initial install will show both the useFetch and useAsyncData composables are typed.

Then if you run npm run generate you will see the useAsyncData composable no longer has a typed data ref. This is because $fetch's types are now conflicting with something in dist.

Before running npm run generate:
Screenshot 2022-11-09 at 10 48 09

After running npm run generate:
Screenshot 2022-11-09 at 10 47 13

You can confirm it is indeed the dist by deleting it and reloading the typescript server results in the types returning.

Additional context

No response

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants