Skip to content

[vitest-angular]: NG0304: 'search' is not a known element #2097

Closed

Description

@jase88

Please provide the environment you discovered this bug in.

If using the HTML search element within an angular component, there is always the following printed to the stderr: NG0304: 'search' is not a known element

For example:

  <search>
  <form>
    <input placeholder="Search" />
  </form>
</search>

example:
https://stackblitz.com/edit/github-juj4mknx?file=src%2Fapp%2Fapp.ts

Which area/package is the issue in?

vitest-angular

Description

If using nx with vitest-analog or a plain Angular project with @analogjs/vitest-angular, in both cases the error NG0304 occurs for search.

If using the default Angular Vitest integration the error does not occur.

Please provide the exception or error you saw

> stderr | src/app/app.spec.ts > App > should create the app
> NG0304: 'search' is not a known element (used in the 'App2' component template):
> 1. If 'search' is an Angular component, then verify that it is included in the '@Component.imports' of this component.
>  2. To allow any element add 'NO_ERRORS_SCHEMA' to the '@Component.schemas' of this component.

Other information

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Activity

  1. ajitzero commented on Mar 3, 2026

    @ajitzero
    Contributor

    This is a bug with @angular/core, which is used by Analog.js

    Please report this in https://github.com/angular/angular

  2. jase88 commented on Mar 3, 2026

    @jase88
    Author

    The support for the search element was added some time ago already to the angular compiler: angular/angular#54944

    It works fine on angular side. It compiles fine while building and also works with the their vitest integration.

    The error only occurs on Tests with vitest Analog in a nx workspace or on a Angular project with @analogjs/vitest-angular.

    I'm unsure where the error is originated

  3. locked and limited conversation to collaborators on Mar 5, 2026
  4. converted this issue into a discussion #2101 on Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions