[Plugin] Conflict when using angular bootstrap

Hello,

I am working on a docView plugin and I'm trying to import an external NPM module which actually is a angular.module. The module I am trying to import, have some useful services and directives in it, directives based on angular-ui-bootstrap version ^2.2.0. In the newer versions of angular bootstrap the $tooltip have been replaced with $uibTooltip, so when testing the plugin I get an error message:
Uncaught Error: [$injector:modulerr] Failed to instantiate module kibana due to: Error: [$injector:unpr] Unknown provider: $tooltipProvider
My opinion is that the angular bootstrap versions conflict and this is why I get the error message. Can someone explain to me a workaround this one?

Thank you,
Alin

Hi Alin,

If your plugin has dependencies which conflict with those in Kibana, it sounds like you have three options:

  1. Fork Kibana and update the dependencies (not recommended because this will be very difficult for you to maintain as we develop Kibana).
  2. Create a PR into Kibana which updates angular-ui-bootstrap to the version you need (may be somewhat difficult, but not impossible).
  3. Use a different dependency or fork the dependency and downgrade the version of angular-ui-bootstrap it uses (not sure how hard this will be; I think you're in a better position to determine this).

I'd recommend trying #2 first. I'd be happy to review your PR and help you get it merged in, just tag me @cjcenizal when you submit it. If that doesn't work, I'd suggest #3. Sometimes taking control over a dependency is best because you can decide exactly what code makes it into your codebase. #1 is the nuclear option and not recommended.

Hope this helps!

Thanks,
CJ

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.