0

In Angular 16, withServerTransition is deprecated. How can I replace it?

enter image description here.

I tried the following code:

imports: [
  BrowserModule,
  { provide: APP_ID, useValue: 'serverApp' },
  ...
],

But I'm getting the following error:

Type '{ provide: InjectionToken<string>; useValue: string; }' is not assignable to type 'any[] | Type<any> | ModuleWithProviders<{}>'.
  Object literal may only specify known properties, and 'provide' does not exist in type 'any[] | Type<any> | ModuleWithProviders<{}>'.ts(2322)
(property) provide: InjectionToken<string>
JSON Derulo
  • 9,780
  • 7
  • 39
  • 56

1 Answers1

1

You almost got it right, this should go in the providers object instead of the import

providers : [{ provide: APP_ID, useValue: 'serverApp' }],
Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134