I am upgrading my app from angular 2.1.2 to angular 5.0.0. and getting this error.
Error: StaticInjectorError[InjectionToken DocumentToken]: \n StaticInjectorError[InjectionToken DocumentToken]: \n
NullInjectorError: No provider for InjectionToken DocumentToken!\n
NullInjectorError: No provider for InjectionToken DocumentToken!\n
at _NullInjector.get (/Users/temp/Documents/GitHub/sample-app/node_modules/@angular/core/bundles/core.umd.js:962:19)\n at resolveToken (/Users/temp/Documents/GitHub/sample-app/node_modules/@angular/core/bundles/core.umd.js:1250:24)\n at tryResolveToken (/Users/temp/Documents/GitHub/sample-app/node_modules/@angular/core/bundles/core.umd.js:1192:16)\n at StaticInjector.get (/Users/temp/Documents/GitHub/sample-app/node_modules/@angular/core/bundles/core.umd.js:1063:20)\n at resolveToken (/Users/temp/Documents/GitHub/sample-app/node_modules/@angular/core/bundles/core.umd.js:1250:24)\n at tryResolveToken (/Users/temp/Documents/GitHub/sample-app/node_modules/@angular/core/bundles/core.umd.js:1192:16)\n at StaticInjector.get (/Users/temp/Documents/GitHub/sample-app/node_modules/@angular/core/bundles/core.umd.js:1063:20)\n at resolveNgModuleDep (/Users/temp/Documents/GitHub/sample-app/node_modules/@angular/core/bundles/core.umd.js:10623:25)\n at _callFactory (/Users/temp/Documents/GitHub/sample-app/node_modules/@angular/core/bundles/core.umd.js:10693:32)\n at _createProviderInstance$1 (/Users/temp/Documents/GitHub/sample-app/node_modules/@angular/core/bundles/core.umd.js:10637:26)",
This is not a Angular CLI app so I have created a repo on git for minimal reproduction of the issue. Please refer the following link
Refer README.md for build and serve the app.
Using webpack:3.11.0 For build this app. Not able to understand the issue.
Same as issue #20101 , which is closed now, but not able to find the solution.- yurzuiimport {HttpClientModule, HttpClient} from '@angular/common/http'; then: imports:[ HttpClientModule]. - Fateme Fazli