Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
E3_DLC
Frequent Visitor

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-visuals-forcegraph/
I'm encountering API problems when "pbiviz packge" is used. (related image)
I've tried to change the API from 5.3.0 to 2.3.1 but it has resolte in another error 'API should be 4.7.0 or higher'.

E3_DLC_2-1728376903951.png

 

Even though i've faced this errors the package was create but is not visibile at all on power bi desktop.
Have been reased this error for the "Format Pane" but while using "pbiviz start", i only encounterd the API error but even tough the error still it is visible and usable. I don't know why.

E3_DLC_3-1728376986525.png
Maybe the problem is only related to the API?
Does anybody have face the same issue? How can i fix it? Thanks in advance for everybody that is going to help me with it🙏

1 ACCEPTED SOLUTION
dm-p
Super User
Super User

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





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




View solution in original post

3 REPLIES 3
dm-p
Super User
Super User

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





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




E3_DLC
Frequent Visitor

Thank you @dm-p !
Your advice helped me to fix my problem.
If i have to do a porting from the older API to the newst, what i need to do? Do you have any documentation about it?

Hi @E3_DLC - you would need to enable/update the API, see what breaks, and make the necessary remediations. I don't have any documentation, but the two things that stick out from memory for the MS APIs are:

 

If you are planning to modernize any of the other packages, you will need to refer to the change logs of those libraries to see what the breaking changes and migration paths are.

 

Cheers,

 

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


My course: Introduction to Developing Power BI Visuals


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors