Skip to content

Missing pipe not caught by production build with AOT #38195

@lukebellamy053

Description

@lukebellamy053

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Description

I have a module with a view that includes a pipe from a library.
The library was not imported into this module and thus the pipe is not included in the module.
IntelliJ correctly flags the missing pipe but the Angular build process (even when AOT is enabled) does not find this problem

The same issue occurs when referencing a pipe that doesn't even exist at all, the builder never shows any warnings or errors

image
The above image shows the app component including a pipe that does not exist. The pipe is highlighted red as IntelliJ recognizes the pipe has not been imported. The terminal below shows a successful production build of the project including the missing pipe. I would expect the build to fail

The example above and the repo below are both built using Nrwl NX but the same issue can be found with a regular Angular project

🔬 Minimal Reproduction

Check out the following repo: https://github.com/lukebellamy053/angular-pipe-error-example
Build either of the applications, both should fail as the pipe is either not imported or just doesn't exist but the build passes in both cases

🔥 Exception or Error

There isn't one but there should be

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: compilerIssues related to `ngc`, Angular's template compilerstate: has PRtype: bug/fix

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions