ya isntala y da menor errores en desarrollo, aun no es perfecto pero ta bien

This commit is contained in:
2025-08-03 18:17:27 -06:00
parent 9b7d653c01
commit 25cd914be4
7 changed files with 232 additions and 118 deletions

View File

@@ -1,9 +1,16 @@
export default defineNuxtPlugin(() => {
// Handle proxy headers and ensure proper request handling
if (process.client) {
// Disable HMR reconnection attempts since we disabled WebSocket HMR
if (window && (window as any).__vite_ping) {
(window as any).__vite_ping = () => Promise.resolve()
// Handle WebSocket connection errors gracefully
const originalConsoleError = console.error
console.error = function(...args) {
// Suppress noisy WebSocket HMR connection errors
if (args[0] && typeof args[0] === 'string' &&
(args[0].includes('WebSocket connection') ||
args[0].includes('failed to connect to websocket'))) {
return // Suppress these specific errors
}
originalConsoleError.apply(console, args)
}
// Override fetch to handle proxy correctly