microsoft / PowerBI-visuals-tools

Contains tools for building/packaging Power BI visuals
https://www.powerbi.com
MIT License
330 stars 149 forks source link

Adding custom formatting options doesn't work in v4.0.4 and above #420

Closed paridhi-agr closed 11 months ago

paridhi-agr commented 2 years ago

I recently upgraded to v4.0.4 of powerbi-visuals-tool from 3.1.18. Previously, I followed the tutorial to Add Formatting options to my custom visual and it worked fine. After the update, my custom visual loads fine in the developer more and with the package .pbiviz but the custom settings don't show up in the format pane. On debugging the issue, I found it fails to create the VisualSettings object and fails here: https://github.com/microsoft/powerbi-visuals-utils-dataviewutils/blob/master/src/dataViewObjectsParser.ts#L47 with the below callstack:- TypeError: Class constructor DataViewObjectsParser cannot be invoked without 'new' at new VisualSettings (:740:47) at Function.getDefault (:16518:16) at Function.parse (:16527:41) at Visual.update (:822:51) at e.update (https://app.powerbi.com/13.0.18129.59/scripts/customVisualsHost.bundle.min.js:19:130291) at https://app.powerbi.com/13.0.18129.59/scripts/customVisualsHost.bundle.min.js:19:187695 at t.trackVisualTime (https://app.powerbi.com/13.0.18129.59/scripts/customVisualsHost.bundle.min.js:19:190879) at t.update (https://app.powerbi.com/13.0.18129.59/scripts/customVisualsHost.bundle.min.js:19:187644) at o. (https://app.powerbi.com/13.0.18129.59/scripts/customVisualsHost.bundle.min.js:19:167008) at https://app.powerbi.com/13.0.18129.59/scripts/customVisualsHost.bundle.min.js:19:1671

I downgraded to 3.1.18 again, and it started to work again. 
Please help resolve this issue for v4.0.4

Env details:
node- v16.5.0
powerbi-visuals-api@3.8.2
powerbi-visuals-utils-dataviewutils@2.2.1
paridhi-agr commented 2 years ago

Verified that the formatting options are functional till v4.0.2

AleksSavelev commented 1 year ago

Could you, please, try it on the new version of the tools, since I wasn't able to reproduce it on my end?