Estoy tratando de llamar a un evento, pero ocurre un error: UnhandledPromiseRejectionWar ning: TypeError: Cannot read property 'emit' of undefined ¿Cómo es posible omitirlo? nodos
import { io } from 'socket.io-client'; import { EventEmitter2, OnEvent } from '@nestjs/event-emitter'; import { SynchronizeService } from './synchronize.service'; import { UserService } from '../user/user.service'; const serverAddress = 'http://localhost:3050' const socket = io(serverAddress, { reconnection: true }) export class SocketClient { constructor( private readonly synchronizeService: SynchronizeService, private eventEmitter: EventEmitter2, private readonly userService: UserService ) {} @OnEvent('order.created') async handler(req):Promise<void> { try{ socket.on('synchronize', () => { }); socket.on('send_from_server', async ({ msg }) => { await this.eventEmitter.emitAsync('order.came') }); socket.emit('synchronize', req); } catch (e) { console.log(e); } } }