Forum Discussion
API issue creating pbiviz package
- 1 year ago
Hi E3_DLC
If you want to use an API version lower than 4.7.0, you will either need to:
- 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)
- 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.
- 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.
- From looking at the changelog, major breaking changes were introduced in 3.3.0, so you may be able to get away with 3.2.2.
- You would install this using npm i -g [email protected]
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
- 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).
Hi E3_DLC
If you want to use an API version lower than 4.7.0, you will either need to:
- 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)
- 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.
- 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.
- From looking at the changelog, major breaking changes were introduced in 3.3.0, so you may be able to get away with 3.2.2.
- You would install this using npm i -g [email protected]
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
- E3_DLC1 year agoFrequent 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?- dm-p1 year agoSuper User
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:
- capabilities.json needing a mandatory privileges array (>= 4.6.0)
- Host capabilities checks moving to a new property (undocumented breaking change in >= 3.8.0)
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