Angular StaticInjectorError[RenderFactory2]:NullInjectorError:没有RenderFactory2的提供程序
[在此处输入图像描述][1]在尝试将apollo客户端安装到我的应用程序之前,我没有任何问题。然后我不得不将angular升级到5.0.0,但之前是4.4.6。 我一直在寻找代码中的错误,但它没有给我参考 这是完整的错误日志: core.js:1350错误:未捕获(承诺中):错误:StaticInjectorError[RenderFactory2]: StaticInjectorError[RenderFactory2]: NullInjectorError:没有RenderFactory2的提供程序! 错误:StaticInjectorError[RenderFactory2]: StaticInjectorError[RenderFactory2]: NullInjectorError:没有RenderFactory2的提供程序!Angular StaticInjectorError[RenderFactory2]:NullInjectorError:没有RenderFactory2的提供程序,angular,Angular,[在此处输入图像描述][1]在尝试将apollo客户端安装到我的应用程序之前,我没有任何问题。然后我不得不将angular升级到5.0.0,但之前是4.4.6。 我一直在寻找代码中的错误,但它没有给我参考 这是完整的错误日志: core.js:1350错误:未捕获(承诺中):错误:StaticInjectorError[RenderFactory2]: StaticInjectorError[RenderFactory2]: NullInjectorError:没有RenderFactory2的
在NullInjector.get(core.js:923)
在resolveToken(core.js:1211)
在tryResolveToken(core.js:1153)
在StaticInjector.get(core.js:1024)
在resolveToken(core.js:1211)
在tryResolveToken(core.js:1153)
在StaticInjector.get(core.js:1024)
在ResolvingModuleDep(core.js:10584)中
在NgModuleRef.get(core.js:11805)
在resolveDep(core.js:12301)
在resolvePromise(zone.js:852)
在resolvePromise(zone.js:809)
评估时(区域js:913)
在ZoneDelegate.invokeTask(zone.js:423)
位于Object.onInvokeTask(core.js:4617)
在ZoneDelegate.invokeTask(zone.js:422)
位于Zone.runTask(Zone.js:195)
在drainMicroTaskQueue(zone.js:601)
- app.module.ts:
从'@angular/platform browser'导入{BrowserModule};
从“@angular/core”导入{NgModule};
从'@angular/router'导入{RouterModule};
从“/app.routing”导入{AppRoutes};
从“./app.component”导入{AppComponent};
从“./layout/admin/admin.component”导入{AdminComponent};
从“ng click outside”导入{ClickOutside Module};
从“./shared/shared.module”导入{SharedModule};
从“@angular/platform browser/animations”导入{BrowserAnimationsModule};
从“./layout/admin/breadcrumbs/breadcrumbs.component”导入{BreadcrumbsComponent};
从“./layout/admin/title/title.component”导入{TitleComponent};
从“./layout/auth/auth.component”导入{AuthComponent};
从'@angular/common/http'导入{HttpClientModule};
从'APOLLO angular'导入{APOLLO模块,APOLLO_选项};
从'apollo angular link http'导入{HttpLinkModule,HttpLink};
从'apollo cache inmemory'导入{InMemoryCache};
@NGD模块({
声明:[
应用组件,
AdminComponent,
面包屑组件,
标题成分,
AuthComponent
],
进口:[
浏览器模块,
BrowserAnimationsModule,
根路径模块(批准),
单击外部模块,
共享模块,
HttpClientModule,
阿波罗舱,
HttpLinkModule
],
供应商:[{
提供:APOLLO_选项,
使用工厂:vef,
副部长:[HttpLink]
}],
引导:[AppComponent]
})
导出类AppModule{}
导出功能vef(httpLink:httpLink){
返回{
缓存:新的InMemoryCache(),
链接:httpLink.create({
uri:'http://localhost:4001/graphql'
})
};
}
- package.json:
你好你能想出来吗?
{
"name": "printingcider-admin",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve --base-href /admin/",
"build": "ng build --base-href /admin/",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"serve": "serve dist"
},
"private": true,
"dependencies": {
"@agm/core": "^1.0.0-beta.6",
"@angular/animations": "5.0.0",
"@angular/common": "5.0.0",
"@angular/compiler": "5.0.0",
"@angular/core": "^5.0.0",
"@angular/forms": "5.0.0",
"@angular/http": "5.0.0",
"@angular/platform-browser": "5.0.0",
"@angular/platform-browser-dynamic": "5.0.0",
"@angular/router": "5.0.0",
"@ng-bootstrap/ng-bootstrap": "1.0.0-beta.5",
"@nicky-lenaers/ngx-scroll-to": "0.4.0",
"@swimlane/ngx-datatable": "9.3.0",
"angular-froala-wysiwyg": "1.0.0",
"angular-io-slimscroll": "2.3.3",
"angular2-chartjs": "0.3.0",
"angular2-datatable": "0.6.0",
"angular2-material-datepicker": "^0.5.0",
"angular2-notifications": "0.7.8",
"angular2-wizard": "0.4.0",
"apollo-angular": "1.6.0",
"apollo-angular-link-http": "1.8.0",
"apollo-cache-inmemory": "1.6.2",
"apollo-client": "2.6.3",
"apollo-link": "1.2.12",
"bootstrap": "4.0.0-beta",
"c3": "0.4.18",
"core-js": "2.4.1",
"css-animator": "2.1.1",
"d3": "4.11.0",
"famfamfam-flags": "1.0.0",
"font-awesome": "4.7.0",
"graphql": "14.4.2",
"graphql-tag": "2.10.1",
"jquery": "3.2.1",
"jquery-sparkline": "2.4.0",
"ng-click-outside": "2.4.1",
"ng-select": "1.0.0-beta.6",
"ng2-currency-mask": "4.3.4",
"ng2-file-upload": "1.2.1",
"ng2-google-charts": "3.2.0",
"ng2-nvd3": "2.0.0",
"ng2-toasty": "4.0.3",
"ng2-ui-switch": "1.0.2",
"ng2-validation": "4.2.0",
"ngx-bootstrap": "1.9.3",
"ngx-chips": "1.4.6",
"ngx-color-picker": "4.4.0",
"ngx-echarts": "1.2.4",
"ngx-quill-editor": "2.2.2",
"node-sass": "4.12.0",
"peity": "3.2.1",
"rxjs": "^6.5.2",
"rxjs-compat": "^6.5.2",
"screenfull": "3.3.1",
"serve": "11.0.0",
"squeezebox": "1.2.0",
"sweetalert2": "6.10.3",
"ti-icons": "0.1.2",
"typescript": "^3.5.2",
"zone.js": "^0.9.1"
},
"devDependencies": {
"@angular/cli": "^1.7.4",
"@angular/compiler-cli": "5.0.0",
"@angular/language-service": "5.0.0",
"@types/jasmine": "~2.5.53",
"@types/jasminewd2": "~2.0.2",
"@types/node": "~6.0.60",
"codelyzer": "~3.1.1",
"jasmine-core": "~2.6.2",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.7.0",
"karma-chrome-launcher": "~2.1.1",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "0.2.2",
"protractor": "~5.1.2",
"ts-node": "~3.2.0",
"tslint": "~5.3.2",
"webpack-bundle-analyzer": "2.9.0"
}
}