Class-transformer: Uncaught TypeError: Reflect.getMetadata is not a function

Created on 16 Oct 2018  路  4Comments  路  Source: typestack/class-transformer

Uncaught TypeError: Reflect.getMetadata is not a function

with import 'reflect-metadata';
at the root react Component
and
I can call the Reflect function in my own code~

question

Most helpful comment

I know this issue is closed for quite a while. I just managed to fix this very same problem. I am using Angular 9.x and it seems anything-reflect has been thrown out of the usual polyfills.ts by default.

It'd be awesome if the author could stress in https://github.com/typestack/class-transformer#browser, that without import 'reflect-metadata' in the polyfills.ts file @Type will not work properly and hence nested objects / classes will not be mapped correctly even though everything is annotated properly.

All 4 comments

@SC30SC please, share your code base because nobody is able to reproduce your problem without any code.

The problem solved.
Its my fault, I don't put the "import 'reflect-metadata'" before import the root component.

I know this issue is closed for quite a while. I just managed to fix this very same problem. I am using Angular 9.x and it seems anything-reflect has been thrown out of the usual polyfills.ts by default.

It'd be awesome if the author could stress in https://github.com/typestack/class-transformer#browser, that without import 'reflect-metadata' in the polyfills.ts file @Type will not work properly and hence nested objects / classes will not be mapped correctly even though everything is annotated properly.

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lazarljubenovic picture lazarljubenovic  路  6Comments

NoNameProvided picture NoNameProvided  路  5Comments

gregsolo-intent picture gregsolo-intent  路  5Comments

braivre picture braivre  路  3Comments

patricknazar picture patricknazar  路  4Comments