Oxooxo
Oxooxo2w ago

Uncaught (in promise) TypeError: Reflect.getMetadata is not a function

Hi all, I'm trying to use dtos like I'm used to in nodejs. I have the following imports import { validate } from "npm:class-validator@0.14.1"; import { plainToClass } from "npm:class-transformer@0.5.1"; And I get the following error: error: Uncaught (in promise) TypeError: Reflect.getMetadata is not a function at file:///Users/foo/Library/Caches/deno/npm/registry.npmjs.org/class-transformer/0.5.1/cjs/decorators/type.decorator.js:13:39 How can I fix it?
2 Replies
Oxooxo
OxooxoOP2w ago
JSR
Reflect.getMetadata - @dx/reflect - JSR
@dx/reflect on JSR: forked from jiawei397/deno-reflect-metadata
Oxooxo
OxooxoOP6d ago
I'm still trying to get it run and so I tried to understand what is going on. First of all the error message comes from the index.js in /Users/me/Library/Caches/deno/npm/registry.npmjs.org/typedi/0.10.0/cjs see (https://docs.typestack.community/typedi/develop/01-getting-started) To use TypeDI you need to npm install typedi reflect-metadata in :deno_logo: : deno install npm:typedi Add npm:typedi@0.10.0 deno install npm:reflect-metadata Add npm:reflect-metadata@0.2.2 Also using it in my .ts file with import "reflect-metadata"; now works. But still I get the message error: Uncaught (in promise) TypeError: Reflect.getMetadata is not a function

Did you find this page helpful?