During the build process error related to prerendering a dynamic route (esperimento/:id)

Discussão em 'Angular' iniciado por Pierpaolo Croce, Abril 10, 2025.

  1. I have an Angular project, and I'm attaching the app.routes.ts file. When I test it with ng serve, the app seems to work perfectly, but when I try to build it I always get this error:

    ✘ [ERROR] The 'esperimento/:id' route uses prerendering and includes parameters, but 'getPrerenderParams' is missing. Please define the 'getPrerenderParams' function for this route in your server routing configuration or specify a different 'renderMode'.


    I can't find a solution. Can anyone help me?

    // app/app.routes.ts
    import { Routes } from '@angular/router';
    import { HomeComponent } from './pages/home/home.component';
    import { ExperimentComponent } from './pages/experiment/experiment.component';

    export const routes: Routes = [
    { path: '', component: HomeComponent },
    { path: 'esperimento/:id', component: ExperimentComponent }
    ];

    Continue reading...

Compartilhe esta Página