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伺服器
- Go 語言的錯誤訊息處理Go
- python 用traceback列印錯誤訊息(轉)Python
- angular中ExpressionChangedAfterItHasBeenCheckedError錯誤AngularExpressError
- 錯誤訊息sales area is not assigned for the header productHeader
- 如何處理錯誤訊息PleaseinstalltheLinuxkernelheaderfilesLinuxHeader
- Laravel 5.5 Validator 自定義錯誤返回訊息Laravel
- 按照Angular官網教程執行簡單的測試程式碼,會遇到expect is not defined的錯誤訊息Angular
- Laravel 的 Validation 檢索驗證錯誤訊息Laravel
- 使用 Spring Boot 提供API錯誤訊息的好方式Spring BootAPI
- cypress 的錯誤訊息 - the element has become detached or removed from the domREM
- 如何處理錯誤訊息Please install the gcc make perl packagesGCPackage
- angular——線上競拍錯誤集錦(一)Angular
- React應用裡Invalid hook call錯誤訊息的處理ReactHook
- CRM中介軟體裡parent not ok的錯誤訊息如何處理
- JDK安全證書一個錯誤訊息 No subject alternative names presentJDK
- SAP HANA 錯誤訊息 SYS_XSA authentication failed SQLSTATE - 28000AISQL
- yarn install 遇到的錯誤訊息 - Error EPERM operation not permitted, open .yarnrcYarnErrorMIT
- 如何處理Docker錯誤訊息:please add——insecure-registryDocker
- 如何處理Docker的錯誤訊息request canceled:Docker代理問題Docker
- 如何處理Eclipse錯誤訊息 The declared package does not match the expected packageEclipsePackage
- 關於 SAP AMDP 呼叫錯誤訊息 client-specific and restricts access to a clientclientREST
- 關於錯誤訊息 RangeError - Maximum call stack size exceeded at XXXError
- 如何根據 SAP UI5 框架程式碼丟擲的錯誤訊息,反查出是哪一行程式碼引起的錯誤訊息試讀版UI框架行程
- Windows下使用python庫 curses遇到錯誤訊息的解決方案WindowsPython
- 如何處理錯誤訊息Please install the Linux kernel header filesLinuxHeader
- 關於 SAP Cloud Connector 500 failed to sign the Certificate 的錯誤訊息CloudAI
- 如何處理SAP雲平臺錯誤訊息 there is no compute unit quota for subaccount
- angular原始碼剖析之Provider系列--QProviderAngular原始碼IDE
- angular原始碼剖析之Provider系列--CacheFactoryProviderAngular原始碼IDE
- 如何處理VirtualBox啟動錯誤訊息:The vboxdrv kernel module is not loaded
- 使用 Excel cdata addin 連線 SAP ABAP 系統時遇到錯誤訊息Excel
- 使用SAP WebIDE消費API Portal裡建立的API時的錯誤訊息WebIDEAPI