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

fix: useFetch and target mode static still make calls to the API #292

Closed
nicolashmln opened this issue Nov 10, 2020 · 3 comments ยท Fixed by #366
Closed

fix: useFetch and target mode static still make calls to the API #292

nicolashmln opened this issue Nov 10, 2020 · 3 comments ยท Fixed by #366
Assignees
Labels
bug Something isn't working

Comments

@nicolashmln
Copy link

๐Ÿ› The bug
When nuxt is generated via the static mode and using useFetch, API calls are still made.

๐Ÿ› ๏ธ To reproduce
Steps to reproduce the behavior:

  1. Using the example from this repo https://github.com/nuxt-community/composition-api/tree/main/example
  2. Execute npm run generate
  3. Execute npm run start
  4. Go to http://localhost:8000/ and browse

At the first load, the payload saved is used and no API calls are made. When you click on a link, even though all the payload.js are downloaded, nuxt still makes an API call.

๐ŸŒˆ Expected behaviour
When you use the fetch function in a normal way (eg. not with the composition API), no API calls are made when generated.

@nicolashmln nicolashmln added the bug Something isn't working label Nov 10, 2020
danielroe added a commit that referenced this issue Feb 14, 2021
* feat: support new fetchKey (Nuxt 2.15+) - closes #364, nuxt/nuxt#8781
* fix: fix issue with refetching/hydration in full static mode - closes #292
* fix: align fetch keys with 2.15 - see nuxt/nuxt#8809
@stigvanbrabant
Copy link

@danielroe i'm still experiencing this issue, is there a specific configuration that needs to be set? i've alread set the target to 'static'. And i am using version ^2.15.8 of nuxt.

@danielroe
Copy link
Member

Would you create a new issue with a reproduction? ๐Ÿ™

@stigvanbrabant
Copy link

Yes i will try to do that tomorrow, i'm actually using the storyblok nuxt module so the useFetch resides inside there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants