# Dependecy injection error when runnung custom plugin

**URL:** <https://discuss.elastic.co/t/dependecy-injection-error-when-runnung-custom-plugin/193310>\
**Category:** Kibana\
**Created:** [August 1, 2019, 11:22am UTC](https://discuss.elastic.co/t/dependecy-injection-error-when-runnung-custom-plugin/193310 "2019-08-01T11:22:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [August 1, 2019, 11:22am UTC](https://discuss.elastic.co/t/dependecy-injection-error-when-runnung-custom-plugin/193310/1 "2019-08-01T11:22:41Z")

</div>

Hello,

I used Kibana plugin generator to create a new App plugin.  
When running the plugin inside kibana, i got this error in Chrome console.  
The plugin is working with no issue, just want to understand how i can fix this issue.

```
angular.js:116 Uncaught (in promise) Error: [$injector:unpr] Unknown provider: mapConfigProvider <- mapConfig <- serviceSettings
http://errors.angularjs.org/1.6.9/$injector/unpr?p0=mapConfigProvider%20%3C-%20mapConfig%20%3C-%20serviceSettings
    at eval (angular.js:116)
    at eval (angular.js:4887)
    at Object.getService [as get] (angular.js:5047)
    at eval (angular.js:4892)
    at getService (angular.js:5047)
    at injectionArgs (angular.js:5072)
    at Object.instantiate (angular.js:5118)
    at Object.eval (angular.js:4955)
    at Object.invoke (angular.js:5106)
    at Object.enforcedReturnValue [as $get] (angular.js:4939)

```

I was getting this error related to es service, fixed by adding import 'ui/autoload/modules'; into app.js (Reference to [https://www.elastic.co/guide/en/kibana/current/development-modules.html](https://www.elastic.co/guide/en/kibana/current/development-modules.html))

```
Uncaught (in promise) Error: [$injector:unpr] Unknown provider: esProvider <- es
http://errors.angularjs.org/1.6.9/$injector/unpr?p0=esProvider%20%3C-%20es
    at eval (angular.js:116)
    at eval (angular.js:4887)
    at Object.getService [as get] (angular.js:5047)
    at eval (angular.js:4892)
    at Object.getService [as get] (angular.js:5047)
    at _callee$ (C:\kibana_dev\kibana\src\legacy\core_plugins\vis_type_vega\public\shim\legacy_dependencies_plugin.ts:51)
    at tryCatch (runtime.js:62)
    at Generator.invoke [as _invoke] (runtime.js:288)
    at Generator.prototype.<computed> [as next] (runtime.js:114)
    at asyncGeneratorStep (C:\kibana_dev\kibana\src\legacy\core_plugins\vis_type_vega\public\shim\legacy_dependencies_plugin.ts:14)
```

---

<div class="post-metadata">

**Author:** ![ylasri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ylasri/32/86120_2.png) [@ylasri](https://discuss.elastic.co/u/ylasri)\
**Post date:** [August 1, 2019, 12:19pm UTC](https://discuss.elastic.co/t/dependecy-injection-error-when-runnung-custom-plugin/193310/2 "2019-08-01T12:19:48Z")

</div>

I refered to this link to fix this issue. [Struggling with regionmapsConfig provider](https://discuss.elastic.co/t/struggling-with-regionmapsconfig-provider/136075)

---

<div class="post-metadata">

**Author:** ![lukeelmers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukeelmers/32/35230_2.png) [@lukeelmers](https://discuss.elastic.co/u/lukeelmers)\
**Post date:** [August 2, 2019, 10:35pm UTC](https://discuss.elastic.co/t/dependecy-injection-error-when-runnung-custom-plugin/193310/3 "2019-08-02T22:35:39Z")

</div>


