ALI
Explore posts from serversCustom Error Page
right, I read somewhere in the documentation ( i think it was for createError) that by default ~/error.vue is rendered with error layout. I tried to create a custom error layout by actually creating one and naming it error.vue but I don't think it worked.. I need to test that again though.
Also, if there is some parsing error like so:
<div> {{ hello world! }} </div>
how does nuxt throw error for that? because first when I navigate to the page which contains this code, it will show me that I have a parsing error in a modal kind of window. because of 'hello world!' . Now, if I refresh the page; I am taken to the ~/error.vue
but I see no layout at all (normally I see default which was setup by my team lead). and I have used useError
there which will get the 'statusCode', 'message' and ' statusMessage' etc. they are displayed but no layout.
but, instead of refreshing the page, if I just press escape and remove that error modal that showed parsing error. try to go to that page again (the one that has parsing error) I am taken to the ~/error.vue
page but this time it prints default error message which is kind of fallback and doesn't show any statusCode etc.
Same thing when I try to render a nuxt context related composable outside the context.
I would really be thankful if you could share your opnion on it. thanks42 replies