How do I access the original URL that caused the error in my custom error page?

Question

Grade: Education Subject: Support
How do I access the original URL that caused the error in my custom error page?
Asked by:
79 Viewed 79 Answers

Answer (79)

Best Answer
(208)
The `error` object provided by `useError()` does not directly contain the original URL. However, you can access the `location.href` within your `error.vue` component using JavaScript's `window.location.href`.