#Any recent sightings of Reflect.getMetadata?

10 messages · Page 1 of 1 (latest)

deep geode
#

I have a custom factory package I built and used in a few little services so far. Just upgraded to 10.3 today, and now I am getting issues when trying to initialise a microservice.

Before going any deeper into the topic, I wanted to ask if anybody seen the infamous reflect-metadata issue while abstracting away modules into their own pre-compiled packages?

TypeError: Reflect.getMetadata is not a function
    at /node-toolbox/node_modules/@nestjs/common/decorators/core/optional.decorator.js:22:34
    at /node-toolbox/node_modules/tslib/tslib.js:111:41

The source code is here: https://github.com/adaliszk/node-toolbox/tree/release/packages/nestjs

Just hoping for some insight, this does not seem to be an issue when using the nest packages directly.

frosty badgeBOT
#

Please run the command npx -y @nestjs/cli info and paste the output in a code block. This will help us determine if there is a version issue in your packages and which version of nest we are triaging.

deep geode
#
[System Information]
OS Version     : macOS Unknown
NodeJS Version : v21.5.0
NPM Version    : 10.2.4 

[Nest CLI]
Nest CLI Version : 10.2.1 

[Nest Platform Information]
schematics version : 10.0.3
cli version        : 10.2.1
#

macOs 14.1.1 (23B81) the real one

#

also:

➜ pnpm --version
8.13.1
#

and

"dependencies": {
    "@nestjs/bull": "^10.0.1",
    "@nestjs/cache-manager": "^2.1.1",
    "@nestjs/common": "^10.3.0",
    "@nestjs/config": "^3.1.1",
    "@nestjs/core": "^10.3.0",
    "@nestjs/event-emitter": "^2.0.3",
    "@nestjs/microservices": "^10.3.0",
    "@nestjs/terminus": "^10.2.0",
    "@types/inquirer": "^8.2.10",
    "body-parser": "^1.20.2",
    "bull": "^4.12.0",
    "cache-manager": "^5.3.2",
    "cache-manager-redis-yet": "^4.1.2",
    "class-transformer": "^0.5.1",
    "class-validator": "^0.14.0",
    "cluster": "latest",
    "os": "latest",
    "pino": "^8.17.2",
    "process": "latest",
    "redis": "^4.6.12",
    "reflect-metadata": "^0.1.14",
    "rxjs": "^7.8.1",
    "source-map-support": "^0.5.21"
  },

which was linked already

deep geode
#

Looks like the solution was as simple as compiling my package with tsc instead of esbuild

warm flicker
frosty badgeBOT
#

This post has been marked as resolved. :white_check_mark:
Please read through the conversation and resolution if you are having the same issue, and then re-open the post if you are still having trouble, providing as much extra information as possible.

deep geode