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
66.9k stars 7.55k forks source link

TypeError _a.log is not a function #11094

Closed rahul-kv closed 1 year ago

rahul-kv commented 1 year ago

Is there an existing issue for this?

Current behavior

upgraded the @nestjs/common, @nestjs/core to the version 9.3.7 and when i start my application using npm run start i get an error as follows : /home/rahul/node_modules/@nestjs/common/services/logger.service.js:51 (_a = this.localInstance) === null || _a === void 0 ? void 0 : _a.log(message, ...optionalParams); ^ TypeError: _a.log is not a function at Logger.log (/home/rahul/node_modules/@nestjs/common/services/logger.service.js:51:75) at Logger.descriptor.value (/home/rahul/node_modules/@nestjs/common/services/logger.service.js:165:27) at /home/rahul/node_modules/@nestjs/core/router/routes-resolver.js:51:37 at Array.forEach () at /home/rahul/node_modules/@nestjs/core/router/routes-resolver.js:49:32 at Array.forEach () at /home/rahul/node_modules/@nestjs/core/router/routes-resolver.js:42:25 at Map.forEach () at RoutesResolver.registerRouters (/home/rahul/node_modules/@nestjs/core/router/routes-resolver.js:36:16) at /home/rahul/node_modules/@nestjs/core/router/routes-resolver.js:32:18

Minimum reproduction code

https://codesandbox.io/s/laughing-mccarthy-f3qj9h?file=/package.json

Steps to reproduce

install the version 9.3.7 for @nestjs/common and @nestjs/core and did an npm run start to get the error as follows: /home/rahul/node_modules/@nestjs/common/services/logger.service.js:51 (_a = this.localInstance) === null || _a === void 0 ? void 0 : _a.log(message, ...optionalParams); ^ TypeError: _a.log is not a function at Logger.log (/home/rahul/node_modules/@nestjs/common/services/logger.service.js:51:75) at Logger.descriptor.value (/home/rahul/node_modules/@nestjs/common/services/logger.service.js:165:27) at /home/rahul/node_modules/@nestjs/core/router/routes-resolver.js:51:37 at Array.forEach () at /home/rahul/node_modules/@nestjs/core/router/routes-resolver.js:49:32 at Array.forEach () at /home/rahul/node_modules/@nestjs/core/router/routes-resolver.js:42:25 at Map.forEach () at RoutesResolver.registerRouters (/home/rahul/node_modules/@nestjs/core/router/routes-resolver.js:36:16) at /home/rahul/node_modules/@nestjs/core/router/routes-resolver.js:32:18

Expected behavior

Expected my application to start listening to my endpoint but i'm getting the error as mentioned in the current behavior box

Package

Other package

No response

NestJS version

8.2.8

Packages versions

"dependencies": { "@apollo/server": "^4.3.2", "@fluffy-spoon/substitute": "^1.208.0", "@keyvaluesystems/nestjs-dataloader": "^2.0.0", "@mergeapi/merge-sdk-typescript": "^3.0.0", "@nestjs/apollo": "^10.1.7", "@nestjs/axios": "^2.0.0", "@nestjs/common": "^9.3.7", "@nestjs/config": "^2.2.0", "@nestjs/core": "^9.3.7", "@nestjs/graphql": "^10.1.7", "@nestjs/passport": "^9.0.0", "@nestjs/platform-express": "^9.3.7", "@nestjs/schedule": "^2.1.0", "@nestjs/terminus": "^9.1.4", "@nestjs/typeorm": "^9.0.1", "@temporalio/client": "^1.5.2", "@temporalio/worker": "^1.5.2", "@temporalio/workflow": "^1.5.2", "@types/superagent": "^4.1.16", "adm-zip": "^0.5.10", "apollo-server-core": "^3.11.1", "aws-sdk": "^2.1310.0", "axios": "^1.3.2", "bcrypt": "^5.1.0", "cache-manager": "^5.1.4", "cache-manager-redis-store": "^3.0.1", "chargebee-typescript": "^2.15.0", "class-transformer": "^0.5.1", "class-validator": "^0.14.0", "cls-hooked": "^4.2.2", "cookie-parser": "^1.4.6", "csv-parse": "^5.3.4", "dataloader": "^2.1.0", "form-data": "^4.0.0", "fs": "0.0.1-security", "gcontacts": "^0.1.0", "google-auth-library": "^8.7.0", "googleapis": "^110.0.0", "graphql": "^16.6.0", "graphql-scalars": "^1.20.1", "graphql-tools": "^8.3.17", "graphql-upload": "^16.0.2", "handlebars": "^4.7.7", "html-pdf": "^3.0.1", "i": "^0.3.7", "ioredis": "^5.2.4", "joi": "^17.7.0", "jsonwebtoken": "^9.0.0", "lodash": "^4.17.21", "moment-timezone": "^0.5.40", "nestjs-s3": "^1.0.1", "node-google-drive": "1.1.2", "node-jose": "^2.1.1", "npm": "^7.22.0", "passport": "^0.6.0", "passport-google-oauth20": "^2.0.0", "pg": "^8.8.0", "pre-commit": "^1.2.2", "redlock": "^5.0.0-beta.2", "reflect-metadata": "^0.1.13", "request-context": "^2.0.0", "rimraf": "^4.1.2", "rxjs": "^7.8.0", "sqs-consumer": "^5.8.0", "superagent": "^8.0.9", "ts-node": "^10.9.1", "typeorm": "0.3.11", "typeorm-naming-strategies": "^4.1.0", "typeorm-transactional-cls-hooked": "^0.1.21", "uuid": "^9.0.0", "winston": "^3.8.2", "yargs": "^17.6.2" }, "devDependencies": { "@nestjs/cli": "^9.2.0", "@nestjs/schematics": "^9.0.4", "@nestjs/testing": "^9.2.1", "@types/adm-zip": "^0.5.0", "@types/bcrypt": "^5.0.0", "@types/cache-manager-redis-store": "^2.0.1", "@types/cookie-parser": "^1.4.3", "@types/cron": "^2.0.0", "@types/express": "^4.17.17", "@types/graphql-upload": "^8.0.11", "@types/hapi__joi": "^17.1.9", "@types/html-pdf": "^3.0.0", "@types/jest": "^29.4.0", "@types/jsonwebtoken": "^9.0.1", "@types/lodash": "^4.14.191", "@types/multer": "^1.4.7", "@types/node": "^18.11.18", "@types/node-jose": "^1.1.10", "@types/passport-google-oauth20": "^2.0.11", "@types/q": "^1.5.5", "@types/request": "^2.48.8", "@types/supertest": "^2.0.12", "@types/uuid": "^9.0.0", "@types/yargs": "^17.0.13", "@typescript-eslint/eslint-plugin": "^5.50.0", "@typescript-eslint/parser": "^5.50.0", "eslint": "^8.33.0", "eslint-config-prettier": "^8.6.0", "eslint-plugin-prettier": "^4.2.1", "jest": "^29.3.1", "prettier": "^2.8.3", "supertest": "^6.3.1", "ts-jest": "^29.0.5", "ts-loader": "^9.4.2", "ts-node": "^10.9.1", "tsconfig-paths": "^4.1.2", "typescript": "4.9.5" },

Node.js version

16.15.0

In which operating systems have you tested?

Other

No response

micalevisk commented 1 year ago

looks like you repro doesn't reproduces the issue

image

I'm using the latest version on Ubuntu just fine :thinking: