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:
@@ -103,6 +103,8 @@
|
||||
<script setup lang="ts">
|
||||
import type { Lote } from '~/composables/useLotes'
|
||||
|
||||
console.log('🟢 LotesTable: <script setup> ejecutándose')
|
||||
|
||||
const emit = defineEmits<{
|
||||
create: []
|
||||
view: [lote: Lote]
|
||||
@@ -110,7 +112,9 @@ const emit = defineEmits<{
|
||||
trazabilidad: [lote: Lote]
|
||||
}>()
|
||||
|
||||
console.log('🟢 LotesTable: Llamando a useLotes()...')
|
||||
const { fetchLotes, TIPOS_LOTE } = useLotes()
|
||||
console.log('🟢 LotesTable: useLotes() completado')
|
||||
|
||||
const lotes = ref<Lote[]>([])
|
||||
const loading = ref(false)
|
||||
|
||||
@@ -80,15 +80,16 @@
|
||||
<script setup lang="ts">
|
||||
import type { Operacion } from '~/composables/useLotes'
|
||||
|
||||
console.log('🟡 OperacionesTable: Script ejecutado')
|
||||
console.log('🟡 OperacionesTable: <script setup> ejecutándose')
|
||||
|
||||
const emit = defineEmits<{
|
||||
create: []
|
||||
view: [operacion: Operacion]
|
||||
}>()
|
||||
|
||||
console.log('🟡 OperacionesTable: Llamando a useLotes()...')
|
||||
const { fetchOperaciones, TIPOS_OPERACION } = useLotes()
|
||||
console.log('🟡 OperacionesTable: Composable cargado')
|
||||
console.log('🟡 OperacionesTable: useLotes() completado, TIPOS_OPERACION:', TIPOS_OPERACION?.length)
|
||||
|
||||
const operaciones = ref<Operacion[]>([])
|
||||
const loading = ref(false)
|
||||
|
||||
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