Skip to content

Alternative for deprecated provideAnimation #2068

@tgt87

Description

@tgt87

The following error is encountered in angular 20.

RuntimeError: NG05105: Unexpected synthetic property @animationState found. Please make sure that:
  - Make sure `provideAnimationsAsync()`, `provideAnimations()` or `provideNoopAnimations()` call was added to a list of providers used to bootstrap an application.
  - There is a corresponding animation configuration named `@animationState` defined in the `animations` field of the `@Component` decorator

The issue can be resolved by adding the deprecated provideAnimations:

// app.config.ts
import { ApplicationConfig } from '@angular/core';
import { provideAnimations } from '@angular/platform-browser/animations'; 

export const appConfig: ApplicationConfig = {
  providers: [
    provideAnimations(), 
    // ... other providers
  ]
};

Any recommendation or advise on alternative to using the deprecated provideAnimations?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions