Angular No provider for EffectsRootModule錯誤訊息
錯誤訊息:
main.ts:12 NullInjectorError: R3InjectorError(AppModule)[EffectsFeatureModule -> EffectsRootModule -> EffectsRootModule -> EffectsRootModule]:
NullInjectorError: No provider for EffectsRootModule!
at NullInjector.get (http://localhost:4200/vendor.js:62758:27)
at R3Injector.get (http://localhost:4200/vendor.js:76765:33)
at R3Injector.get (http://localhost:4200/vendor.js:76765:33)
at R3Injector.get (http://localhost:4200/vendor.js:76765:33)
at injectInjectorOnly (http://localhost:4200/vendor.js:62613:33)
at Module.ɵɵinject (http://localhost:4200/vendor.js:62623:57)
at Object.EffectsFeatureModule_Factory [as factory] (http://localhost:4200/vendor.js:137576:239)
at R3Injector.hydrate (http://localhost:4200/vendor.js:77003:63)
at R3Injector.get (http://localhost:4200/vendor.js:76753:33)
at http://localhost:4200/vendor.js:76799:25
(anonymous) @ main.ts:12
invoke @ zone-evergreen.js:364
run @ zone-evergreen.js:123
(anonymous) @ zone-evergreen.js:857
invokeTask @ zone-evergreen.js:399
runTask @ zone-evergreen.js:167
drainMicroTaskQueue @ zone-evergreen.js:569
Promise.then (async)
scheduleMicroTask @ zone-evergreen.js:552
scheduleTask @ zone-evergreen.js:388
scheduleTask @ zone-evergreen.js:210
scheduleMicroTask @ zone-evergreen.js:230
scheduleResolveOrReject @ zone-evergreen.js:847
then @ zone-evergreen.js:979
bootstrapModule @ core.js:42679
./src/main.ts @ main.ts:11
webpack_require @ bootstrap:79
0 @ unless.directive.ts:33
webpack_require @ bootstrap:79
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.js:1
應用程式自己開發的module:
EffectsFeatureModule是dependent type之一:
value是null,所以報錯:
在app.module.ts里加上一行語句即可解決問題:
EffectsModule.forRoot([AppEffects]),
這個forRoot方法為EffectsRootModule提供了可用的provider:
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
相關文章
- Angular 錯誤訊息:ERROR Error NullInjectorError No provider for XXAngularErrorNullIDE
- Angular 依賴注入錯誤訊息:ERROR Error NullInjectorError No provider for XXAngular依賴注入ErrorNullIDE
- Angular 內容投影出現 No provider for TemplateRef found 錯誤的單步除錯AngularIDE除錯
- SAP錯誤訊息除錯之七種武器:讓所有的錯誤訊息都能被定位除錯
- Angular 伺服器端渲染應用的一個錯誤訊息 - localStorage is not definedAngular伺服器
- 使用 Angular Universal 進行伺服器端渲染避免 window is not defined 的錯誤訊息Angular伺服器
- 如何處理錯誤訊息PleaseinstalltheLinuxkernelheaderfilesLinuxHeader
- angular中ExpressionChangedAfterItHasBeenCheckedError錯誤AngularExpressError
- python 用traceback列印錯誤訊息(轉)Python
- 什麼是好的錯誤訊息?
- 錯誤訊息sales area is not assigned for the header productHeader
- path_provider 編譯錯誤指導IDE編譯
- Laravel 5.5 Validator 自定義錯誤返回訊息Laravel
- Laravel 的 Validation 檢索驗證錯誤訊息Laravel
- 按照Angular官網教程執行簡單的測試程式碼,會遇到expect is not defined的錯誤訊息Angular
- flutter庫【path_provider】編譯錯誤指導FlutterIDE編譯
- 使用 Spring Boot 提供API錯誤訊息的好方式Spring BootAPI
- SAP Spartacus RouterModule.forRoot() called twice 的錯誤訊息
- 關於錯誤訊息 RangeError - Maximum call stack size exceeded at XXXError
- SAP HANA 錯誤訊息 SYS_XSA authentication failed SQLSTATE - 28000AISQL
- cypress 的錯誤訊息 - the element has become detached or removed from the domREM
- 如何處理錯誤訊息Please install the Linux kernel header filesLinuxHeader
- 如何處理錯誤訊息Please install the gcc make perl packagesGCPackage
- 如何處理Docker錯誤訊息:please add——insecure-registryDocker
- angular原始碼剖析之Provider系列--QProviderAngular原始碼IDE
- angular原始碼剖析之Provider系列--CacheFactoryProviderAngular原始碼IDE
- 關於 SAP Cloud Connector 500 failed to sign the Certificate 的錯誤訊息CloudAI
- JDK安全證書一個錯誤訊息 No subject alternative names presentJDK
- React應用裡Invalid hook call錯誤訊息的處理ReactHook
- yarn install 遇到的錯誤訊息 - Error EPERM operation not permitted, open .yarnrcYarnErrorMIT
- 如何處理VirtualBox啟動錯誤訊息:The vboxdrv kernel module is not loaded
- 如何處理Eclipse錯誤訊息 The declared package does not match the expected packageEclipsePackage
- angular——線上競拍錯誤集錦(一)Angular
- 使用 SAP fiori-tools-proxy 時遇到的錯誤訊息 - invalid version
- 關於 SAP AMDP 呼叫錯誤訊息 client-specific and restricts access to a clientclientREST
- CRM中介軟體裡parent not ok的錯誤訊息如何處理
- Windows下使用python庫 curses遇到錯誤訊息的解決方案WindowsPython
- 如何處理Docker的錯誤訊息request canceled:Docker代理問題Docker