-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(vua-app): clone mount error to prevent mutating read-only error object #5214
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #5214 +/- ##
=======================================
Coverage 96.32% 96.32%
=======================================
Files 73 73
Lines 2476 2476
Branches 628 628
=======================================
Hits 2385 2385
Misses 76 76
Partials 15 15 Continue to review full report at Codecov.
|
packages/vue-app/template/client.js
Outdated
errorHandler(err) | ||
const improvedErr = new Error('[nuxt] Error while mounting app: ' + err.message) | ||
improvedErr.original = err | ||
improvedErr.stack = improvedErr.stack.split('\n').slice(0,2).join('\n') + '\n' + err.stack |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very low-level hack which may make error handler even more unstable for different browsers / errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be, yeah. But What would be another solution? Checking for a DOMException (and other errors with read-only values)? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing is that in IE for example improvedErr.stack would be undefined and crash
new Error().stack
undefined
@manniL Isn't |
Welp, that was too simple 😂 You are right @pi0 |
Types of changes
Resolves #5056
Checklist: