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

Duplicate response when calling a composable with useLazyFetch inside #14499

Closed
lucassimines opened this issue Aug 4, 2022 · 3 comments · Fixed by nuxt/framework#6632
Closed

Comments

@lucassimines
Copy link

lucassimines commented Aug 4, 2022

Environment


  • Operating System: Darwin
  • Node Version: v16.14.2
  • Nuxt Version: 3.0.0-rc.6
  • Package Manager: npm@8.8.0
  • Builder: vite
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-16xwyo?file=app.vue,composables%2FuseApiFetch.ts

Describe the bug

The bug is that, when using useLazyFetch inside a composable, and then call multiple different requests using the custom function, it returns the same data as the first request.

It is not generating an unique key

Additional context

No response

Logs

No response

@aerksn
Copy link

aerksn commented Sep 4, 2022

any workaround for this one?

@manniL
Copy link
Member

manniL commented Sep 4, 2022

any workaround for this one?

The workaround is to set the key manually for now (different for each usage where state shouldn't be shared)

@aerksn
Copy link

aerksn commented Sep 4, 2022

any workaround for this one?

The workaround is to set the key manually for now (different for each usage where state shouldn't be shared)

cool, thanks for quick reply! :)

@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
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.

4 participants