2

I Installed Angular Material in my Angular Project. I had followed all the steps which were given in the Material documentation, but when I tried to run the application with 'npm start', I'm getting warnings and errors related to InjectionToken and Renderer2.

The error messages which I get in the console:

WARNING in ./~/@angular/material/@angular/material.es5.js 138:33-47 "export 'InjectionToken' was not found in '@angular/core'
WARNING in ./~/@angular/material/@angular/material.es5.js 826:35-49 "export 'InjectionToken' was not found in '@angular/core'
WARNING in ./~/@angular/material/@angular/material.es5.js 1010:12-21 "export 'Renderer2' was not found in '@angular/core'
WARNING in ./~/@angular/material/@angular/material.es5.js 1388:12-21 "export 'Renderer2' was not found in '@angular/core'
WARNING in ./~/@angular/material/@angular/material.es5.js 3177:12-21 "export 'Renderer2' was not found in '@angular/core'
ERROR in C:/Users/naray/MEAN-project/client/node_modules/@angular/cdk/typings/bidi/directionality.d.ts (8,34): Module '"C:/Users/naray/MEAN-project/client/node_mo dules/@angular/core/index"' has no exported member 'InjectionToken'.
ERROR in C:/Users/naray/MEAN-project/client/node_modules/@angular/cdk/typings/table/cell.d.ts (8,22): Module '"C:/Users/naray/MEAN-project/client/node_modules/@angular/core/index"' has no exported member 'Renderer2'.
ERROR in C:/Users/naray/MEAN-project/client/node_modules/@angular/cdk/typings/table/row.d.ts (28,31): Type'IterableDiffer' is not generic.
ERROR in C:/Users/naray/MEAN-project/client/node_modules/@angular/cdk/typings/table/table.d.ts (8,69): Module '"C:/Users/naray/MEAN-project/client/node_modules/@angular/core/index"' has no exported member 'Renderer2'.
ERROR in C:/Users/naray/MEAN-project/client/node_modules/@angular/cdk/typings/table/table.d.ts (8,80): Module '"C:/Users/naray/MEAN-project/client/node_modules/@angular/core/index"' has no exported member 'TrackByFunction'.
ERROR in C:/Users/naray/MEAN-project/client/node_modules/@angular/material/typings/core/overlay/scroll/scrollable.d.ts (8,49): Module '"C:/Users/naray/MEAN-project/client/node_modules/@angular/core/index"' has no exported member 'Renderer2'.
3
  • 2
    whats the version of Angular you have installed. upgrage it to 4+ and then check. Commented Aug 25, 2017 at 11:32
  • 2
    import { Renderer2 } from '@angular/core'; requires angular core 4.0+ Commented Aug 25, 2017 at 11:50
  • Thanks for the response. I've upgraded to Angular 4 using "npm install @angular/common@latest @angular/compiler@latest @angular/compiler-cli@latest @angular/core@latest @angular/forms@latest @angular/http@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/platform-server@latest @angular/router@latest @angular/animations@latest typescript@latest --save" Commented Aug 25, 2017 at 13:37

1 Answer 1

1

In my package.json I had both a reference to @ionic/angular and ionic-angular.

ionic-angular seems to be deprecated and replaced with @ionic/angular so when I installed ionic-angular, this resolved the error.

Sign up to request clarification or add additional context in comments.

1 Comment

Bit confused. What did you perform? Did you remove ionic-angular?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.