Debug: Agregar plugin de error handler y más logging
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:
2025-11-21 23:42:08 -06:00
parent b0b179d945
commit bd31838139
3 changed files with 29 additions and 2 deletions

View 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)
}
})