nestjs / nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀
https://nestjs.com
MIT License
67.76k stars 7.64k forks source link

@nestjs/websockets 9.3.3 failure #11065

Closed MarcP9 closed 1 year ago

MarcP9 commented 1 year ago

Is there an existing issue for this?

Current behavior

In this new version when trying to work whit a Gateway, it crash saying

TypeError: this.metadataScanner.getAllMethodNames is not a function at GatewayMetadataExplorer.explore (/app/node_modules/@nestjs/websockets/gateway-metadata-explorer.js:13:14)

Imposible to make work the documentation examples, think that not happends when i use the library version 9.2.*

Minimum reproduction code

https://github.com/nestjs/nest

Steps to reproduce

No response

Expected behavior

thats, my chatGateway test:

import { SubscribeMessage, WebSocketGateway, WebSocketServer } from '@nestjs/websockets'; import { Socket, Server } from 'socket.io';

@WebSocketGateway({ cors: true }) export class ChatGateway {

@WebSocketServer() server: Server;

@SubscribeMessage('sendMessage') async handleSendMessage(client: Socket, payload: string): Promise { return 'hello world!!!!'; } }

Package

Other package

No response

NestJS version

No response

Packages versions

Node.js version

No response

In which operating systems have you tested?

Other

No response

micalevisk commented 1 year ago

what's the output of npx nest info?


related with this comment btw: https://github.com/nestjs/nest/issues/11057#issuecomment-1419895125

kamilmysliwiec commented 1 year ago

Make sure your @nestjs/websockets package version matches the version of @nestjs/core