While implementing jwt with @nestjs/passport
, I followed the instructions to use @UseGuards(AuthGuard())
. However, I encountered the following exception:
common_1.Optional is not a function
Any ideas on what could be causing this issue?
Dependencies:
"@nestjs/common": "^5.0.0",
"@nestjs/core": "^5.0.0", "@nestjs/cqrs": "^5.1.1", "@nestjs/jwt": "^0.2.0", "@nestjs/mongoose": "^5.1.0", "@nestjs/passport": "^5.1.0", "@nestjs/swagger": "^2.4.4", "@nestjs/typeorm": "^5.2.2", "automapper-ts": "^1.9.0", "config": "^2.0.1", "fastify-formbody": "^2.0.0", "lodash": "^4.17.10", "mongodb": "^3.1.6", "mongoose": "^5.2.9", "mysql": "^2.16.0", "nestjs-rmq": "^0.1.3", "nestjs-typegoose": "^5.0.1", "passport": "^0.4.0", "passport-jwt": "^4.0.0", "reflect-metadata": "^0.1.12", "rxjs": "^6.0.0", "typegoose": "^5.4.0", "typeorm": "^0.2.7", "typescript": "^2.6.2",