Skip to content

Docs discourage using of NO_ERRORS_SCHEMA #49269

@amakhrov

Description

@amakhrov

Describe the problem that you experienced

There are two places in the docs that cover NO_ERRORS_SCHEMA.

The API page for NO_ERRORS_SCHEMA says

The usage of this schema is generally discouraged because it prevents useful validation and may hide real errors in your template

It sounds like a developer should avoid using it, not mentioning the applicability context (this is true for app code, but less so for unit tests).

The "Component testing scenarios" page. This one has more permissive language and warns about **over-**using it. Yet, it doesn't explain when it's appropriate to use it, so overall it discourages developers from using it in unit tests, again.

Additionally, the justification it provides is "it disables compile-time checks". However, since the full app is still AOT-compiled, and NO_ERRORS_SCHEMA is only used in the component testing scenario, it doesn't sound like a problem to me.

Enter the URL of the topic with the problem

https://angular.io/guide/testing-components-scenarios

Describe what you were looking for in the documentation

No response

Describe the actions that led you to experience the problem

No response

Describe what you want to experience that would fix the problem

As a developer, I would like to better understand when I should use NO_ERRORS_SCHEMA and when I should not.

Add a screenshot if that helps illustrate the problem

No response

If this problem caused an exception or error, please paste it here

No response

If the problem is browser-specific, please specify the device, OS, browser, and version

No response

Provide any additional information here in as much as detail as you can

No response

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