mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
feat(app): enable global vue error handler only in dev
With production builds, some Vue warns are being changed to errors this may lead to unwanted error pages.
This commit is contained in:
parent
f23a6d34a4
commit
400363860a
@ -31,6 +31,7 @@ let router
|
||||
const NUXT = window.__NUXT__ || {}
|
||||
NUXT.components = window.__COMPONENTS__ || null
|
||||
|
||||
<% if (debug) { %>
|
||||
// Setup global Vue error handler
|
||||
const defaultErrorHandler = Vue.config.errorHandler
|
||||
Vue.config.errorHandler = function (err, vm, info) {
|
||||
@ -52,6 +53,7 @@ Vue.config.errorHandler = function (err, vm, info) {
|
||||
}
|
||||
console.error(err);
|
||||
}
|
||||
<% } %>
|
||||
|
||||
// Create and mount App
|
||||
createApp()
|
||||
|
Loading…
Reference in New Issue
Block a user