Why Parse failed: regular expression in Angular 6

Module parse failed: Unterminated regular expression in Angular 6 ?

Angular throws this error

because the syntax you have used which is not valid in angular 6.

The used syntax can be work for importing “router” in angular 4.

But it will not work in angular 6.

Hence exact syntax is : – import { RouterModule, Routes } from ‘@angular/router’;

update the above syntax ,issue will be resolved.

Check it also

check for the documentation


Leave a Reply

Your email address will not be published. Required fields are marked *