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
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
ssr: true,
|
ssr: true,
|
||||||
compatibilityDate: '2025-07-15',
|
|
||||||
devtools: { enabled: true },
|
devtools: { enabled: true },
|
||||||
css: ['~/assets/css/main.css'],
|
css: ['~/assets/css/main.css'],
|
||||||
modules: ['@nuxt/image', '@nuxt/ui', '@vite-pwa/nuxt'],
|
modules: ['@nuxt/image', '@nuxt/ui', '@vite-pwa/nuxt'],
|
||||||
|
|
||||||
// Performance optimizations
|
// Performance optimizations
|
||||||
experimental: {
|
experimental: {
|
||||||
payloadExtraction: false,
|
payloadExtraction: false
|
||||||
viewTransition: true
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// Vite config
|
// Vite config
|
||||||
@@ -23,21 +21,10 @@ export default defineNuxtConfig({
|
|||||||
'.nucleoriofrio.com',
|
'.nucleoriofrio.com',
|
||||||
'whatsapp.nucleoriofrio.com'
|
'whatsapp.nucleoriofrio.com'
|
||||||
]
|
]
|
||||||
},
|
|
||||||
build: {
|
|
||||||
cssCodeSplit: true,
|
|
||||||
rollupOptions: {
|
|
||||||
output: {
|
|
||||||
manualChunks: {
|
|
||||||
'vendor-ui': ['@nuxt/ui']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
app: {
|
app: {
|
||||||
baseURL: process.env.BASE_URL || '/',
|
|
||||||
head: {
|
head: {
|
||||||
title: 'WhatsApp Nucleo',
|
title: 'WhatsApp Nucleo',
|
||||||
link: [
|
link: [
|
||||||
@@ -55,7 +42,6 @@ export default defineNuxtConfig({
|
|||||||
},
|
},
|
||||||
|
|
||||||
nitro: {
|
nitro: {
|
||||||
baseURL: process.env.BASE_URL || '/',
|
|
||||||
experimental: {
|
experimental: {
|
||||||
openAPI: true
|
openAPI: true
|
||||||
},
|
},
|
||||||
@@ -89,29 +75,18 @@ export default defineNuxtConfig({
|
|||||||
display: 'standalone',
|
display: 'standalone',
|
||||||
background_color: '#075e54',
|
background_color: '#075e54',
|
||||||
theme_color: '#075e54',
|
theme_color: '#075e54',
|
||||||
launch_handler: {
|
|
||||||
client_mode: 'navigate-existing'
|
|
||||||
},
|
|
||||||
icons: [
|
icons: [
|
||||||
{ src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
|
{ src: '/icons/icon-192.png', sizes: '192x192', type: 'image/png' },
|
||||||
{ src: '/icons/icon-512.png', sizes: '512x512', 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' }
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
workbox: {
|
workbox: {
|
||||||
globPatterns: ['**/*.{js,css,html,png,svg,webp,ico,json,woff2}'],
|
globPatterns: ['**/*.{js,css,html,png,svg,webp,ico,json,woff2}'],
|
||||||
navigateFallback: undefined,
|
navigateFallback: undefined,
|
||||||
cleanupOutdatedCaches: true,
|
cleanupOutdatedCaches: true
|
||||||
maximumFileSizeToCacheInBytes: 4 * 1024 * 1024
|
|
||||||
},
|
|
||||||
client: {
|
|
||||||
installPrompt: true,
|
|
||||||
periodicSyncForUpdates: 3600
|
|
||||||
},
|
},
|
||||||
devOptions: {
|
devOptions: {
|
||||||
enabled: process.env.NODE_ENV === 'development',
|
enabled: false
|
||||||
type: 'module'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
20
package.json
20
package.json
@@ -10,20 +10,22 @@
|
|||||||
"postinstall": "nuxt prepare"
|
"postinstall": "nuxt prepare"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nuxt/image": "^1.11.0",
|
"@hapi/boom": "^10.0.1",
|
||||||
"@nuxt/ui": "^4.0.0",
|
"@nuxt/image": "^1.8.1",
|
||||||
"@vite-pwa/nuxt": "^0.9.1",
|
"@nuxt/ui": "^3.0.0",
|
||||||
"@whiskeysockets/baileys": "^7.0.0-rc.9",
|
"@vite-pwa/nuxt": "^0.10.6",
|
||||||
"nuxt": "^4.1.2",
|
"@whiskeysockets/baileys": "^6.7.9",
|
||||||
|
"nuxt": "^3.14.0",
|
||||||
"pg": "^8.13.1",
|
"pg": "^8.13.1",
|
||||||
"pino": "^9.5.0",
|
"pino": "^9.5.0",
|
||||||
"qrcode": "^1.5.4",
|
"qrcode": "^1.5.4",
|
||||||
"typescript": "^5.9.2",
|
"vue": "^3.5.13",
|
||||||
"vue": "^3.5.22",
|
"vue-router": "^4.5.0"
|
||||||
"vue-router": "^4.5.1"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@types/node": "^22.10.1",
|
||||||
"@types/pg": "^8.11.10",
|
"@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
|
* Stores credentials and keys in the database instead of files
|
||||||
*/
|
*/
|
||||||
import type { AuthenticationCreds, SignalDataTypeMap } from '@whiskeysockets/baileys'
|
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'
|
import { query } from '../../utils/database'
|
||||||
|
|
||||||
export interface PostgresAuthState {
|
export interface PostgresAuthState {
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
* BaileysManager - Manages multiple WhatsApp instances
|
* BaileysManager - Manages multiple WhatsApp instances
|
||||||
* Singleton pattern for managing all Baileys connections
|
* 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,
|
DisconnectReason,
|
||||||
fetchLatestBaileysVersion,
|
fetchLatestBaileysVersion,
|
||||||
makeCacheableSignalKeyStore,
|
makeCacheableSignalKeyStore,
|
||||||
useMultiFileAuthState,
|
|
||||||
type WASocket,
|
|
||||||
type BaileysEventMap,
|
|
||||||
Browsers
|
Browsers
|
||||||
} from '@whiskeysockets/baileys'
|
} = pkg
|
||||||
import { Boom } from '@hapi/boom'
|
import { Boom } from '@hapi/boom'
|
||||||
import { EventEmitter } from 'events'
|
import { EventEmitter } from 'events'
|
||||||
import QRCode from 'qrcode'
|
import QRCode from 'qrcode'
|
||||||
|
|||||||
Reference in New Issue
Block a user