fix: Double requests being made on client-side
See original GitHub issue🐛 The bug
After some testing of the module it looks like that it’s actually doing two requests per page on the client-side. One for the static json
file and one for the actual API.
I’ve tried the example from the docs with adding a process.server
check to my useAsyncData
but that just returns false
.
🛠️ To reproduce
https://stackblitz.com/github/danielroe/nuxt-full-static/tree/main/playground
🌈 Expected behaviour
When click on the individual posts I would expect it to only make a request for the static json
file but it also makes a request to the API 🙂

ℹ️ Additional context
No response
Issue Analytics
- State:
- Created a year ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to Avoid Duplicate API Requests? - Daffodil Software
Here is what leads to duplicate API request issues and how to overcome the problem.
Read more >Apollo Client sends duplicate requests · Issue #7722 - GitHub
For every GraphQL query, I see logs for two requests. I know these are being sent by Apollo Client because I added a...
Read more >Avoid duplicate POSTs with REST - Stack Overflow
Another solution that's been proposed for this is POST Once Exactly (POE), in which the server generates single-use POST URIs that, ...
Read more >Handling multiple ad requests with UserContext
Since ad requests are made asynchronously, ensuring the proper ad manager is associated with the correct context can seem to be a daunting ......
Read more >Advanced Usage — Requests 2.28.1 documentation
It also persists cookies across all requests made from the Session instance, ... You can also specify a local cert to use as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@danielroe hmm - me neither.
Unfortunately I’m not able to create a proper reproduction of what happens in my own project, since it’s currently running with a local api.
I suspect that it might be caused by a timing issue with the
Object.assign
and big amounts of data in the client plugin, which might cause the route to resolved before the data is added to the payload cache.I’ll try to do some testing with wrapping it in a promise and manually resolving once data has been mapped and make a PR if I find a solution 😄
Also, in the above repo, from the posts.vue page, clicking on the various post titles, it opens the same post.
If post with id:10 is clicked first, then going back to all posts and clicking a different title, opens post id:10 again.