Circular reference problem while creating React plugin for Kibana

Circular reference to "VisProvider" found while resolving private deps: registry -> function(savedVisualizations){return savedVisualizations} -> VisProvider -> registry -> MynewVisType

Is there something I might be missing?

@tylersmalley / @jbudz - any help here ? Thanks

Rashmi

@timroes - I think this q belongs more to Viz team .

Thanks
Rashmi

Hi Mishal,

could you please share the code of the file that contains your new vis type?

Cheers,
Tim

Here's my code

import { CATEGORY } from 'ui/vis/vis_category';
import { VisFactoryProvider } from 'ui/vis/vis_factory';
import { VisTypesRegistryProvider } from 'ui/registry/vis_types';

    const MyNewVisType = (Private) => {
      const VisFactory = Private(VisFactoryProvider);
      return VisFactory.createReactVisualization({
          name: 'ml_d3',
          title:'d3',
          icon:'fa fa-eye',
          description: 'D3',
         category: CATEGORY.OTHER,
         visConfig: {
             template: ReactComponent
          }
      });
    }
      VisTypeRegistryProvider.register(MyNewVisType);
      export default MyNewVisType;

And here's my react component

import React,{Component} from "react"
export default class ReactComponent extends Component{
 render(){
    return (
      <div><h1>React component</h1></div>
    );
}
}

You really need to post the FULL file for that. Cyclic imports will occur cause of some imports, so stripping the imports from the code, doesn't help much to find out the problem :slight_smile:

Hi @timroes,

I have edited my post accordingly. Please take a look again. :slight_smile:

Hmm nothing in there looks suspicious. You could try not to export the actual vis definition, since that's usually not needed unless you manually import it somewhere (if so it would be interesting to hear where you imported it). Also did you run any modifications or hacks on the vis type registry itself?

No modifications to the type registry.

I think in that case we would need the source code of the full plugin to find out what's possibly broken there. Is this somewhere available on GitHub you can link to?

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