Error in Angular 17 SSR (Reflect.getMetadata is not a function)

Discussão em 'Angular' iniciado por Renat Gubaev, Março 2, 2025.

  1. Renat Gubaev

    Renat Gubaev Guest

    I get "Reflect.getMetadata is not a function" error when trying so serve Angular 17 with SSR after adding class with @Type() decorator from "class-transformer".

    I've tried to import 'reflect-metadata' before main code and add "reflect-metadata" in polyfills, but it doesn't work.

    How to reproduce this error:

    1. ng new --ssr
    2. npm i class-transformer
    3. Add code

    @Type(() => Date) date: Date;


    to the main component.

    If you have any ideas how to fix it, please let me know.

    Thank you.

    Continue reading...

Compartilhe esta Página