Forum Discussion

E3_DLC's avatar
E3_DLC
Frequent Visitor
1 year ago
Solved

API issue creating pbiviz package

Hi, i'm completly new to the development of Custom Visuals. I'm trying to modifing an existing visual, Force Direct Graph. Here is the link to the official repo: https://github.com/Microsoft/powerbi...
  • dm-p's avatar
    1 year ago

    Hi E3_DLC 

     

    If you want to use an API version lower than 4.7.0, you will either need to:

    1. Use the version of powerbi-visuals-tools included with the visual dependencies (from looking at package.json, v3.0.9, which, along with API 2.3.1, are both very old and no longer supported).
      • If you're running pbiviz package to package the visual, you're likely using a globally installed version, which is too new to use the visual APIs it was designed with.
      • Instead, try using npm run package, which will use the version of powerbi-visuals-tools local to the project.
      • You should also do a similar workaround when developing (i.e., npm run start instead of pbiviz start)
    2. Migrate the visual code to use API >= 4.7.0. This is not ideal in the short term, but better if you are planning to do any kind of substantial work on this older visual, particularly if you want to add modern features, as many things have been introduced since API 2.3.1.
    3. If you have installed powerbi-visuals-tools globally and want to run this way, downgrade it to a suitable version that uses the older APIs, as the latest versions will only work with newer APIs.

    Option #1 will probably be the lowest barrier to entry, but you will have significantly less problems, maintenance-wise, if you go for option #2, as there will be no support from MS if going with option #1 - they will likely tell you to migrate tools, API and codebase first before they can provide any specific assistance if you're having trouble.

     

    Hopefully some of this will be useful. Good luck!

     

    Daniel