I've upgraded an app from Angular 4.2 to 5, but got this error:
unhandled exception occurred while processing the request
, more specifically:
NodeInvocationException: No provider for PlatformRef! Error: No provider for PlatformRef! at injectionError (e:\myapp\ClientApp\dist\vendor.js:12066:90)
The app also uses webpack and ASP.NET Core
.
I have installed node v9.1
, and typescript 2.6.1
.
I also have updated package.json
, with the command:
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
And afterwards, ran the following:
npm install --save-dev @ngtools/webpack@latest
I've also used HttpClient
instead of Http
:
import { HttpClient } from '@angular/common/http';
.....
getThings() {
return this.http.get('/api/things');
}
If I downgrade back Angular 4, the app works fine, is there anything in my line of thought that has been done incorrectly?