fix: Corregir versiones de npm y imports ESM de Baileys
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 3m7s
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 3m7s
- Downgrade a Nuxt 3.14.0 (Nuxt 4 no existe todavía) - Downgrade @nuxt/ui a ^3.0.0 - Downgrade Baileys a ^6.7.9 (versión estable) - Corregir imports ESM de Baileys en auth-state.ts y manager.ts - Remover compatibilityDate (específico de Nuxt 4)
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
export default defineNuxtConfig({
|
||||
ssr: true,
|
||||
compatibilityDate: '2025-07-15',
|
||||
devtools: { enabled: true },
|
||||
css: ['~/assets/css/main.css'],
|
||||
modules: ['@nuxt/image', '@nuxt/ui', '@vite-pwa/nuxt'],
|
||||
|
||||
// Performance optimizations
|
||||
experimental: {
|
||||
payloadExtraction: false,
|
||||
viewTransition: true
|
||||
payloadExtraction: false
|
||||
},
|
||||
|
||||
// Vite config
|
||||
@@ -23,21 +21,10 @@ export default defineNuxtConfig({
|
||||
'.nucleoriofrio.com',
|
||||
'whatsapp.nucleoriofrio.com'
|
||||
]
|
||||
},
|
||||
build: {
|
||||
cssCodeSplit: true,
|
||||
rollupOptions: {
|
||||
output: {
|
||||
manualChunks: {
|
||||
'vendor-ui': ['@nuxt/ui']
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
app: {
|
||||
baseURL: process.env.BASE_URL || '/',
|
||||
head: {
|
||||
title: 'WhatsApp Nucleo',
|
||||
link: [
|
||||
@@ -55,7 +42,6 @@ export default defineNuxtConfig({
|
||||
},
|
||||
|
||||
nitro: {
|
||||
baseURL: process.env.BASE_URL || '/',
|
||||
experimental: {
|
||||
openAPI: true
|
||||
},
|
||||
@@ -89,29 +75,18 @@ export default defineNuxtConfig({
|
||||
display: 'standalone',
|
||||
background_color: '#075e54',
|
||||
theme_color: '#075e54',
|
||||
launch_handler: {
|
||||
client_mode: 'navigate-existing'
|
||||
},
|
||||
icons: [
|
||||
{ src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
|
||||
{ src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png' },
|
||||
{ src: '/icons/icon-192-maskable.png', sizes: '192x192', type: 'image/png', purpose: 'maskable' },
|
||||
{ src: '/icons/icon-512-maskable.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' }
|
||||
{ src: '/icons/icon-512.png', sizes: '512x512', type: 'image/png' }
|
||||
]
|
||||
},
|
||||
workbox: {
|
||||
globPatterns: ['**/*.{js,css,html,png,svg,webp,ico,json,woff2}'],
|
||||
navigateFallback: undefined,
|
||||
cleanupOutdatedCaches: true,
|
||||
maximumFileSizeToCacheInBytes: 4 * 1024 * 1024
|
||||
},
|
||||
client: {
|
||||
installPrompt: true,
|
||||
periodicSyncForUpdates: 3600
|
||||
cleanupOutdatedCaches: true
|
||||
},
|
||||
devOptions: {
|
||||
enabled: process.env.NODE_ENV === 'development',
|
||||
type: 'module'
|
||||
enabled: false
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
20
package.json
20
package.json
@@ -10,20 +10,22 @@
|
||||
"postinstall": "nuxt prepare"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nuxt/image": "^1.11.0",
|
||||
"@nuxt/ui": "^4.0.0",
|
||||
"@vite-pwa/nuxt": "^0.9.1",
|
||||
"@whiskeysockets/baileys": "^7.0.0-rc.9",
|
||||
"nuxt": "^4.1.2",
|
||||
"@hapi/boom": "^10.0.1",
|
||||
"@nuxt/image": "^1.8.1",
|
||||
"@nuxt/ui": "^3.0.0",
|
||||
"@vite-pwa/nuxt": "^0.10.6",
|
||||
"@whiskeysockets/baileys": "^6.7.9",
|
||||
"nuxt": "^3.14.0",
|
||||
"pg": "^8.13.1",
|
||||
"pino": "^9.5.0",
|
||||
"qrcode": "^1.5.4",
|
||||
"typescript": "^5.9.2",
|
||||
"vue": "^3.5.22",
|
||||
"vue-router": "^4.5.1"
|
||||
"vue": "^3.5.13",
|
||||
"vue-router": "^4.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.10.1",
|
||||
"@types/pg": "^8.11.10",
|
||||
"@types/qrcode": "^1.5.5"
|
||||
"@types/qrcode": "^1.5.5",
|
||||
"typescript": "^5.7.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
* Stores credentials and keys in the database instead of files
|
||||
*/
|
||||
import type { AuthenticationCreds, SignalDataTypeMap } from '@whiskeysockets/baileys'
|
||||
import { initAuthCreds, BufferJSON, proto } from '@whiskeysockets/baileys'
|
||||
import pkg from '@whiskeysockets/baileys'
|
||||
const { initAuthCreds, BufferJSON, proto } = pkg
|
||||
import { query } from '../../utils/database'
|
||||
|
||||
export interface PostgresAuthState {
|
||||
|
||||
@@ -2,15 +2,15 @@
|
||||
* BaileysManager - Manages multiple WhatsApp instances
|
||||
* Singleton pattern for managing all Baileys connections
|
||||
*/
|
||||
import makeWASocket, {
|
||||
import type { WASocket, BaileysEventMap } from '@whiskeysockets/baileys'
|
||||
import pkg from '@whiskeysockets/baileys'
|
||||
const {
|
||||
default: makeWASocket,
|
||||
DisconnectReason,
|
||||
fetchLatestBaileysVersion,
|
||||
makeCacheableSignalKeyStore,
|
||||
useMultiFileAuthState,
|
||||
type WASocket,
|
||||
type BaileysEventMap,
|
||||
Browsers
|
||||
} from '@whiskeysockets/baileys'
|
||||
} = pkg
|
||||
import { Boom } from '@hapi/boom'
|
||||
import { EventEmitter } from 'events'
|
||||
import QRCode from 'qrcode'
|
||||
|
||||
Reference in New Issue
Block a user