Error page not being shown when using throw render(404) and suspense query #1959
Unanswered
jasonhilldm
asked this question in
Help & Questions
Replies: 1 comment 4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using Tanstack useSuspensQuery and withFallback from vike-react-query to load data for the UI, e.g. an article based on a slug from the URL.
If I am unable to find the article in the database, I want to raise a 404 error so have been calling throw render(404). However, when I do this, I am seeing console errors instead of the error page being rendered:
Uncaught Error: Abort Render
I have created a repro based off a simple bati scaffolded React app:
https://stackblitz.com/edit/vitejs-vite-kbbtzx
When you click the Data Fetching link, I am calling throw render(404) from within the query function, but you will see console errors instead of the error page configured in the Vike app.
What is the correct way to have errors from within the suspense query handled by Vike and to present the user with the error page?
Beta Was this translation helpful? Give feedback.
All reactions