title: nestjs @SubscribeMessage UnhandledPromiseRejectionWarning: TypeError: this.contextUtils.getContextFactory is not a function
body: <p>I am seeing this error in my nestjs application</p>
  
  <p>(node:16561) UnhandledPromiseRejectionWarning: TypeError: this.contextUtils.getContextFactory is not a function
      at WsContextCreator.getMetadata (/Users/sajankumarvijayan/Documents/projects/review.io/node_modules/@nestjs/websockets/context/ws-context-creator.js:73:50)
      at WsContextCreator.create (/Users/sajankumarvijayan/Documents/projects/review.io/node_modules/@nestjs/websockets/context/ws-context-creator.js:28:68)</p>
  
  <p>Here is my example code:</p>
  
  <pre><code>import {
     SubscribeMessage,
     WebSocketGateway,
     WebSocketServer,
  } from '@nestjs/websockets';
  import { Server } from 'ws';
  
  @WebSocketGateway()
  export class SocketGateway {
    @WebSocketServer()
    server: Server;
  
    @SubscribeMessage('event')
    onEvent(client: any, data: any): void {
      this.server.emit('update');
    }
  }
  </code></pre>
  
  <p>If i remove the @SubscribeMessage annotation the error is gone. I think this exception is not handled but looking for some answers and help to fix this. Thank you.</p>