Debug: Agregar plugin de error handler y más logging
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m5s
All checks were successful
build-and-deploy / build-and-deploy (push) Successful in 1m5s
- Crear plugin error-handler.ts para capturar todos los errores - Captura errores de app:error, vue:error y errorHandler - Agregar logs en script setup de componentes - Logs antes y después de llamar a useLotes() - Esto nos mostrará exactamente dónde crashea la app
This commit is contained in:
22
nuxt4/app/plugins/error-handler.ts
Normal file
22
nuxt4/app/plugins/error-handler.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
nuxtApp.hook('app:error', (error) => {
|
||||
console.error('❌❌❌ ERROR DE APLICACIÓN CAPTURADO:', error)
|
||||
console.error('❌ Mensaje:', error.message)
|
||||
console.error('❌ Stack:', error.stack)
|
||||
console.error('❌ Causa:', error.cause)
|
||||
})
|
||||
|
||||
nuxtApp.hook('vue:error', (error, instance, info) => {
|
||||
console.error('❌❌❌ ERROR DE VUE CAPTURADO:', error)
|
||||
console.error('❌ Info:', info)
|
||||
console.error('❌ Componente:', instance?.$options?.name || instance?.$options?.__name)
|
||||
console.error('❌ Stack:', error.stack)
|
||||
})
|
||||
|
||||
nuxtApp.vueApp.config.errorHandler = (error, instance, info) => {
|
||||
console.error('❌❌❌ ERROR HANDLER VUE:', error)
|
||||
console.error('❌ Info:', info)
|
||||
console.error('❌ Mensaje:', error.message)
|
||||
console.error('❌ Stack:', error.stack)
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user