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~
@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.
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.tsby default.It'd be awesome if the author could stress in https://github.com/typestack/class-transformer#browser, that without
import 'reflect-metadata'in thepolyfills.tsfile@Typewill not work properly and hence nested objects / classes will not be mapped correctly even though everything is annotated properly.