Search code examples
angularangular8tslint

Router gives no exported member error after migration to Angular 8


I just migrated to Angular 8 and I started getting the error

Module '"../../node_modules/@angular/router/router"' has no exported member 'NoPreloading'.

This error comes from the line:

import { NoPreloading, RouterModule, Routes } from '@angular/router';

It happens for all members of @angular/router. What am I doing wrong? Dispite the error everything still works fine.


Solution

  • This may be due to some missing node-modules in your old project after the migration. Here are the steps to follow,

    1. Remove your package-lock.json file
    2. Delete the node_modules folder from your project’s working directory
    3. Run npm install