How can I resolve a Duplicate identifier 'by' error?

How can I resolve a Duplicate identifier 'by' error?

I was doing some test using the DomSanitizer class. I undo all my changes using git checkout -- . and I got this console error:

I was doing some test using the DomSanitizer class. I undo all my changes using git checkout -- . and I got this console error:

I checkout into another git branch and the error is still there.

This are my specs

Angular CLI: 6.2.8
Node: 8.12.0
OS: win32 x64
Angular: 6.1.10
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.8.8 @angular-devkit/build-angular 0.8.8 @angular-devkit/build-optimizer 0.8.8 @angular-devkit/build-webpack 0.8.8 @angular-devkit/core 0.8.8 @angular-devkit/schematics 0.8.8 @angular/cli 6.2.8 @ngtools/webpack 6.2.8 @schematics/angular 0.8.8 @schematics/update 0.8.8 rxjs 6.2.2 typescript 2.9.2 webpack 4.16.4

This is the error

ERROR in node_modules/@angular/core/src/sanitization/security.d.ts(32,3): error TS2300: Duplicate identifier 'by'.
node_modules/@angular/platform-browser/src/security/dom_sanitization_service.d.ts(83,31): error TS2720: Class 'DomSanitizer' incorrectly implements class 'Sanitizer'. Did you mean to extend 'Sanitizer' and inherit its members as a subclass?
  Property 'by' is missing in type 'DomSanitizer'.

I don't use DomSanitizer anywhere in my project, so I don't understand why I get this error when I run ng serve

This is what node_modules/@angular/platform-browser/src/security/dom_sanitization_service.d.tscontains:

export declare abstract class DomSanitizer implements Sanitizer {

My text editor was complaining about implements and I changed to extends.

I got a new error message:

ERROR in node_modules/@angular/core/src/sanitization/security.d.ts(32,3): error TS2300: Duplicate identifier 'by'.

This is the content of node_modules/@angular/core/src/sanitization/security.d.ts

export declare abstract class Sanitizer {
  by: any;
  by: any;
    abstract sanitize(context: SecurityContext, value: {} | string | null): string | null;
}

It contains the by: any property twice, so I deleted one and it worked like a charm.

Can someone explain me why this happended? I don't understand why the content of a node_modules file could sudenly change.

angular node-js

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to Hire Node.js Developers And How Much Does It Cost?

A Guide to Hire Node.js Developers who can help you create fast and efficient web applications. Also, know how much does it cost to hire Node.js Developers.

Angular 8 Node & Express JS File Upload

In this Angular 8 and Node.js tutorial, we are going to look at how to upload files on the Node server. To create Angular image upload component, we will be using Angular 8 front-end framework along with ng2-file-upload NPM package; It’s an easy to use Angular directives for uploading the files.

Hire Node.JS Developers | Skenix Infotech

We are providing robust Node.JS Development Services with expert Node.js Developers. Get affordable Node.JS Web Development services from Skenix Infotech.

How to Implement Server Side Pagination with Angular 8 and Node.js

A simple example of how to implement server-side pagination in Angular 8 with a Node.js backend API.

Hands on with Node.Js Streams | Examples & Approach

The practical implications of having Streams in Node.js are vast. Nodejs Streams are a great way to handle data chunks and uncomplicate development.