Server-side plugins execute twice when rendering error.vue
#33675
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
When accessing an unregistered route or triggering a Nuxt error that renders the
error.vuepage,the server-side Nuxt plugins are executed twice.
This behavior noticeably slows down page rendering because my server-side plugin performs some time-consuming asynchronous operations.
How can I make sure that my server-side plugin or handler executes only once per request to avoid performance issues, even when error.vue is rendered?
Code
File:
app/plugins/demo.server.tsBeta Was this translation helpful? Give feedback.
All reactions