angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Angular 10 ng build doesn't flag missing module in app.module but HTML does

Open CieloVistaSoftware opened this issue 6 years ago • 3 comments

🐞 bug report

Affected Package

ng build

Is this a regression?

Not sure

Description

Shouldn't the build fail?

angularbuilderror

🔬 Minimal Reproduction

Will attempt a minimal StackBlitz recreation later.

🔥 Exception or Error

Only found in red lines in HTML see above.

🌍 Your Environment

Angular Version:


Angular CLI: 10.0.1
Node: 12.18.0
OS: win32 x64

Angular: 10.0.3
... core
Ivy Workspace: Yes

Package                             Version
-------------------------------------------------------------
@angular-devkit/architect           0.901.10
@angular-devkit/build-angular       0.1000.1
@angular-devkit/build-optimizer     0.901.11
@angular-devkit/build-webpack       0.1000.1
@angular-devkit/core                10.0.1
@angular-devkit/schematics          10.0.1
@angular/animations                 10.0.2
@angular/cdk                        10.0.1
@angular/cli                        10.0.1
@angular/common                     10.0.2
@angular/compiler                   10.0.2
@angular/compiler-cli               10.0.2
@angular/forms                      10.0.2
@angular/language-service           10.0.2
@angular/material                   10.0.1
@angular/platform-browser           10.0.2
@angular/platform-browser-dynamic   10.0.2
@angular/router                     10.0.2
@ngtools/webpack                    8.3.28
@schematics/angular                 10.0.1
@schematics/update                  0.1000.1
rxjs                                6.6.0
typescript                          3.9.6
webpack                             4.43.0

Anything else relevant? The app module is missing the paginator module which is root cause of the issue.

CieloVistaSoftware avatar Jul 14 '20 17:07 CieloVistaSoftware

Hi @Javaman2, it's likely that you are building in JIT and not AOT. Angular template errors are only available when using AOT mode.

Can you confirm that you have aot: true under build -> options in angular.json

alan-agius4 avatar Jul 15 '20 08:07 alan-agius4

Thanks Alan that was exactly the problem. I added this to the angular.json file, subsequent builds flagged the error.

"build": {
               "builder": "@angular-devkit/build-angular:browser",
               "options": {
                  "aot": true,

CieloVistaSoftware avatar Jul 15 '20 13:07 CieloVistaSoftware

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.