Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem when autoloading styles in Kibana plugin #5349

Closed
kimjoar opened this issue Nov 9, 2015 · 7 comments
Closed

Problem when autoloading styles in Kibana plugin #5349

kimjoar opened this issue Nov 9, 2015 · 7 comments
Labels
bug Fixes for quality problems that affect the customer experience Feature:Plugins

Comments

@kimjoar
Copy link
Contributor

kimjoar commented Nov 9, 2015

I get this error when only autoloading styles:

angular.js:12477 Error: [$injector:unpr] Unknown provider: NotifierProvider <- Notifier <- globalState <- timefilter
http://errors.angularjs.org/1.4.7/$injector/unpr?p0=NotifierProvider%20%3C-%20Notifier%20%3C-%20globalState%20%3C-%20timefilter
    at angular.js:68
    at angular.js:4289
    at Object.getService [as get] (angular.js:4437)
    at angular.js:4294
    at getService (angular.js:4437)
    at Object.invoke (angular.js:4469)
    at instantiate (private.js:144)
    at get (private.js:162)
    at Private (private.js:182)
    at new <anonymous> (global_state.js:10)

This only happens if I set up the router.

I've got a minimal example running with this error. Here is the main file, index.js:

module.exports = (kibana) => new kibana.Plugin({
  id: 'my-app',

  uiExports: {
    app: {
      title: 'My app',
      main: 'plugins/my-app',
      autoload: kibana.autoload.styles
    }
  }
});

and in public/index.js:

import chrome from 'ui/chrome';
import routes from 'ui/routes';

chrome
  .setRootController(() => {
    console.log('app is running');
  });

routes
  .when('/', {
      template: '<div></div>',
      controller: () => {
        console.log('root')
      }
  })
  .otherwise({ redirectTo: '/' });

Whenever I refresh this app I get the error. If I add more routes and add urls to jump between them, I get this error:

angular.js:12477 Error: Circular refrence to "StateProvider" found while resolving private deps: StateProvider
    at instantiate (private.js:135)
    at get (private.js:162)
    at Private (private.js:182)
    at new <anonymous> (global_state.js:10)
    at invoke (angular.js:4478)
    at Object.instantiate (angular.js:4486)
    at Object.<anonymous> (angular.js:4346)
    at Object.invoke (angular.js:4478)
    at Object.enforcedReturnValue [as $get] (angular.js:4330)
    at Object.invoke (angular.js:4478)
@rashidkpc
Copy link
Contributor

@spalger can you look at this?

@spalger
Copy link
Contributor

spalger commented Nov 12, 2015

@BigFunger didn't you have to work around this in your plugin?

@kimjoar
Copy link
Contributor Author

kimjoar commented Nov 15, 2015

Btw, if I disable Kibana and Elasticsearch, but don't disable autoloading, I get the following error when running my plugin:

Error: Uncaught Error: [$injector:unpr] Unknown provider: kbnIndexProvider <- kbnIndex <- config
http://errors.angularjs.org/1.4.7/$injector/unpr?p0=kbnIndexProvider%20%3C-%20kbnIndex%20%3C-%20config (http://localhost:5601/bundles/commons.bundle.js:31998)
at window.onerror (notify.js:39)

If I disable autoloading I end up with #5349.

My config:

$ cat config/kibana.dev.yml 
---

kibana.enabled: false
elasticsearch.enabled: false
optimize:
  sourceMaps: '#cheap-module-source-map'
  unsafeCache: true
  lazyPrebuild: false

@rashidkpc rashidkpc added bug Fixes for quality problems that affect the customer experience and removed discuss labels Nov 23, 2015
@kimjoar
Copy link
Contributor Author

kimjoar commented Feb 17, 2016

At some point this was fixed. Haven't seen this problem lately on master.

@kimjoar kimjoar closed this as completed Feb 17, 2016
@salyh
Copy link

salyh commented Feb 23, 2016

i face this issue with kibana 4.4.1

@salyh
Copy link

salyh commented Mar 4, 2016

@tony-cocco
Copy link

I'm seeing the config error in 4.5 using the kibana-plugin generator as well. I don't have the option to change kibana versions...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Plugins
Projects
None yet
Development

No branches or pull requests

6 participants