Skip to content

Commit 74ce629

Browse files
DMezhenskyithePunderWoman
authored andcommitted
refactor(platform-browser): improve error message for UNEXPECTED_SYNTHETIC_PROPERTY (#58983)
Improve error message by adding instructions for enabling animations using standalone API. PR Close #58983
1 parent 731dc3a commit 74ce629

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/core/test/animation/animation_integration_spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4521,8 +4521,8 @@ const DEFAULT_COMPONENT_ID = '1';
45214521

45224522
function syntheticPropError(name: string, nameKind: string) {
45234523
return `NG05105: Unexpected synthetic ${nameKind} ${name} found. Please make sure that:
4524-
- Either \`BrowserAnimationsModule\` or \`NoopAnimationsModule\` are imported in your application.
4525-
- There is corresponding configuration for the animation named \`${name}\` defined in the \`animations\` field of the \`@Component\` decorator (see https://angular.io/api/core/Component#animations).`;
4524+
- Make sure \`provideAnimationsAsync()\`, \`provideAnimations()\` or \`provideNoopAnimations()\` call was added to a list of providers used to bootstrap an application.
4525+
- There is a corresponding animation configuration named \`${name}\` defined in the \`animations\` field of the \`@Component\` decorator (see https://angular.dev/api/core/Component#animations).`;
45264526
}
45274527

45284528
describe('when modules are missing', () => {

packages/platform-browser/src/dom/dom_renderer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ function checkNoSyntheticProp(name: string, nameKind: string) {
403403
throw new RuntimeError(
404404
RuntimeErrorCode.UNEXPECTED_SYNTHETIC_PROPERTY,
405405
`Unexpected synthetic ${nameKind} ${name} found. Please make sure that:
406-
- Either \`BrowserAnimationsModule\` or \`NoopAnimationsModule\` are imported in your application.
407-
- There is corresponding configuration for the animation named \`${name}\` defined in the \`animations\` field of the \`@Component\` decorator (see https://angular.io/api/core/Component#animations).`,
406+
- Make sure \`provideAnimationsAsync()\`, \`provideAnimations()\` or \`provideNoopAnimations()\` call was added to a list of providers used to bootstrap an application.
407+
- There is a corresponding animation configuration named \`${name}\` defined in the \`animations\` field of the \`@Component\` decorator (see https://angular.dev/api/core/Component#animations).`,
408408
);
409409
}
410410
}

0 commit comments

Comments
 (0)