Monitor the status of your Angular CLI build with real-time notifications

Encountered an interesting issue while trying to integrate the 'webpack-notifier' plugin into a new Angular 7 application. The goal was to have balloon notifications for build failures when running 'ng build --watch' in the console.

TL;DR;

When using 'ng build --watch', the array of errors for the webpack 'done' compiler hook may be empty even if the build fails. Is there a workaround to display the errors array for broken build notifications?


Here are the details:

Initially, I created a new Angular project with 'ng new my-app'

Then added a custom webpack config following instructions from 'ngx-build-plus' on GitHub

Next, included the 'webpack-notifier' source and used it in webpack.partial.js as shown below:

module.exports = {
    plugins: [
        new WebpackNotifierPlugin()
    ]
}

Tested it with 'ng build --watch --extra-webpack-config webpack.partial.js'

After making intentional breaking changes to the app.component.ts file, saw error in console but no popup notification. Troubleshooting revealed that the 'stats.compilation.errors' array could be empty despite errors being present.

The WebpackNotifierPlugin utilizes webpack compiler hooks which expect certain data formats. Debugging showed inconsistencies between the expected error array and actual errors displayed in the console.

Need help identifying the root cause of this behavior and potential workarounds. Any insights would be appreciated!

Answer №1

The reason behind this behavior is that the forked type checker fails to propagate semantic errors further down the line. A temporary solution is to include "forkTypeChecker": false in the build options (located in projects.[app-name].achitect.build.options within angular.json).

For a more comprehensive explanation, refer to the Angular CLI issue tracker: https://github.com/angular/angular-cli/issues/13870

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The Karma testing feature in Angular Quickstart encounters issues right from the start

When attempting to run karma tests after a clean install of the official Angular quickstart on Windows 10, I encountered an issue. Following a series of four commands, here is what happened: C:\projects\temp>git clone https://github.com/angul ...

Tips for properly utilizing GeolocationPosition in TypeScript

Our goal is to utilize the Geolocation API to access the user's location. This particular code snippet appears to be functioning well: if (navigator.geolocation) { navigator.geolocation.getCurrentPosition((position: GeolocationPosition) => conso ...

Troubleshooting the issue of file URL chunks in Laravel and Vue.js

I'm currently working on a web application using Laravel and Vue. I have deployed the application to the following route on the host: https://novintech.info/panel Everything seems to be fine, except that the chunks file is referencing the wrong path ...

What is the process for connecting a form to a model in Angular 6 using reactive forms?

In the time before angular 6, my approach involved utilizing [(ngModel)] to establish a direct binding between my form field and the model. However, this method is now considered deprecated (unusable with reactive forms) and I find myself at a loss on how ...

The Angular template driven forms are flagging as invalid despite the regExp being a match

My input looks like this: <div class="form-group"> <label for="power">Hero Power</label> <input [(ngModel)]="model.powerNumber" name="powerNumber" type="text" class="form-control" pattern="^[0-9]+$"id= ...

Facing issues during the unit testing of an angular component method?

I'm facing an issue with a unit test that is failing. Below is the code for reference: Here is my typescript file: allData: any; constructor(@Inject(MAT_DIALOG_DATA) private data, private dialogRef: MatDialogRef<MyComponent>, priva ...

An issue has occurred with ng-material-multilevel-menu: NullInjectorError - MultilevelMenuService provider is missing. This problem is specific to

I have been working with Angular 12 and I am looking to integrate the ng-material-multilevel-menu plugin. Following this link, I tried implementing the multilevel menu. Although it compiled successfully, I encountered an error in the browser. After some ...

Is there a way to dynamically adjust the size of mat dialog content to match the size of the mat dialog in

I have adjusted the size of my mat dialog, but the content is still stuck at the original size. To illustrate, here are some images: https://i.stack.imgur.com/2lLV2.jpg After researching, I found that it can be resized using CSS. I attempted the followin ...

Retrieving a MongoDB collection using its unique ID

Here's a query that may seem straightforward. I have two collections in MongoDB - one named "users" with an objectId, and the other named "listings" which has the userId. I am looking to retrieve documents from the listings collection by searching fo ...

Tips on accessing validator errors in Angular

Is there a way to extract the value from the 'minLength' validator error in order to use it in a message? This is my current HTML setup: <div class="mt-2" *ngIf="ngControl.control.errors?.minlength"> {{ &ap ...

The Angular 7 template falls short of occupying the entire page

I am currently working on converting an HTML page into my Angular project. While it functions correctly in the HTML version, it does not fill up the entire page when transferred to Angular. You can view an example of this issue on StackBlitz at the followi ...

Encountering an issue with extending the MUI color palette, receiving a "reading 'dark'" error due to properties of undefined

Encountering an issue when trying to expand the MUI color palette—getting this error instead: Error: Cannot read properties of undefined (reading 'dark') Take a look at my theme.ts file below: const theme = createTheme({ palette: { pri ...

Guide to linking two input fields using a single datepicker

To achieve the goal of filling two input fields simultaneously, take a look at the following code snippet: <mat-form-field> <input matInput [matDatepicker]="startDate" formControlName="SaleDate" /> ...

Is it possible to insert data into SQL Server from an Angular application without relying on .NET Core?

Is there a way to extract data from an Angular-made form and store it in a SQL Server table without the need for .NET Core? ...

Encountering a problem while trying to incorporate Mapbox GL JS into an Angular 8 web application

I'm currently working on incorporating mapbox into my simple web application, but I'm encountering difficulties when attempting to add it. At this point, I've already created a mapbox service and a map component. My approach involved using ...

What is the process for retrieving paginated data from the store or fetching new data from an API service within an Angular 2 application using ngrx-effects?

After coming across this insightful question and answer about the structure of paginated data in a redux store, I found myself pondering how to implement similar principles using ngrx/store in an angular 2 application. { entities: { users: { 1 ...

I have an Observable but I need to convert it into a String

Seeking assistance with Angular translation service and Kendo.UI components. In the Kendo.UI documentation, it mentions the use of MessageService for component translation implementation. To achieve this, an abstract class must be extended containing a m ...

Incorporating Google Pay functionality within Angular applications

I have been attempting to incorporate Google Pay into my Angular project, but I am struggling to find reliable resources. My main issue revolves around the following code... <script async src="https://pay.google.com/gp/p/js/pay.js" onloa ...

How can I dynamically insert various FormGroup instances into a FormArray in Angular?

I am looking to dynamically populate the order array with multiple dishes. Each dish will be stored as a FormGroup in the form, such as pizza, salad, drink, or any other type of dish. Prior to adding any items, the form structure should resemble this: this ...

Why does Angular keep changing my request method to OPTIONS?

I've been working on setting up a JWT Interceptor in Angular. Following the example provided here, I implemented my JWT interceptor using the code snippet below: import { HttpInterceptor, HttpRequest, HttpEvent, HttpHandler, HttpHeaders } from &apos ...