useAsyncData does not pass errors from server to client-side
See original GitHub issueEnvironment
- Operating System:
Linux
- Node Version:
v14.18.1
- Nuxt Version:
3.0.0-27294839.7e5e50b
- Package Manager:
yarn@1.22.15
- Bundler:
Vite
Reproduction
https://stackblitz.com/edit/github-ygz9df?file=app.vue
Describe the bug
On server side the error content is rendered as expected while the client side says it’s null.
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:25 (5 by maintainers)
Top Results From Across the Web
Data Fetching - Nuxt
Downside: Won't work for server side rendering. Make the API call in the asyncData method of the page component and pass the data...
Read more >Why useFetch is not working on page change in nuxt3 on ...
useFetch tries to cache the document for you and reuses the cache when you load the next page. To avoid that behavior you...
Read more >Understanding Difference Between Asyncdata Fetch Nuxt
Fetching data in your application is not just about loading it but also doing so at the right time (i.e. server-side vs. client-side)....
Read more >Nuxt3 doesn't fetch new data after client-side navigation : r/Nuxt
Or use useAsyncData() and supply a dynamic key value that changes based on your different data you expect to receive (usually an ID,...
Read more >Nuxt 3 | Data fetching | useAsyncData | useFetch - YouTube
Hi all,Thanks a lot guys for voting in the poll that I ran last week. It was super helpful.As per the majority, here...
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 FreeTop 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
Top GitHub Comments
After a bit of search trough the ohmyfetch (the library used by nuxtjs mentioned in the documentation) I obtained the status code easily, this is my solution:
This is my first response to a GitHub issue, hope i wrote it at least understandable
@nndnha I understand. One note: if you need to get the status code on client side and don’t mind an extra request, you can also rerun the fetch.