fix(nuxt): avoid destructuring error prop (works around upstream bug) #20795
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π Linked issue
Fixes #20789
β Type of change
π Description
This regression is probably caused by the changes regarding the experimental prop destructuring in Vue 3.3, which might not cover the edge case where someone is using destructuring without enabling this new experimental feature, although I haven't look really deep into this.
Fortunately it seems like we can avoid this bug by using a props variable and destructuring it later. This way the error object should still lose it's reactivity but now the compiled output is valid.
How I tested:
In the playground I changed
app.vue
to:Added an index page in
pages/index.vue
:And navigated to a random url, like
/this-does-not-exist
, to get to the error page. Without changes I was able to reproduce the error in the linked ticket, but after the changes it works fine.π Checklist