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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ConnectedRoman
Frequent Visitor

Visual Studio Code cannot find VisualUpdateOptions

Hello,

 

I'm currently trying to learn how I can create custom visuals and PowerBI.

 

This is the guide I'm following. I'm stuck at the "Adding Databinding to Bar Chart" part. Specifically where I have to create the visualTransform function. 

 

When I write the method head, Visual Studio Code underlines "VisualUpdateOptions" and "IVisualHost" red, saying it can't find those. 

Error.PNG

 

I have copied the dependencies from the package.json on github into the package.json of my project and installed them. I also added all the dependencies into the pbiviz.json and tsconfig.json.

 

When I download the project from github and run it it works, without being underlined.

 

What am I missing?

 

UPDATE: The problem was that I didn't specify the barChart.ts file in the tsconfig.json. 

 

FIx.PNG

1 ACCEPTED SOLUTION
MawashiKid
Resolver II
Resolver II

Hi ConnectedRoman,

 

From what I see from the code you provided, it seems Visual Studio Code [using pbiviz new ... ] has generated a v1.7.0 version while the sample demo you're refering to was built in an earlier v1.5.0 version. So if you use any portion of the sample demo "AS-IS" - particularly pbiviz.json or tsconfig.son this may generate conflicts with your version some point and may be the reason you see the error. 

So in order to avoid conflict and use demo code sample "AS-IS" you'll either have the choice to import a v1.5.0 code version in your app, under the .api folder

apifolder.png

or keep your existing v1.7.0 version and make a double-check to make sure any piece of code you may have borrowed from demo sample is pointing to the right version, especially pbiviz.json

pbiviz.png

 

and tsconfig.json
tsconfig.png

 

View solution in original post

3 REPLIES 3
MawashiKid
Resolver II
Resolver II

Hi ConnectedRoman,

 

From what I see from the code you provided, it seems Visual Studio Code [using pbiviz new ... ] has generated a v1.7.0 version while the sample demo you're refering to was built in an earlier v1.5.0 version. So if you use any portion of the sample demo "AS-IS" - particularly pbiviz.json or tsconfig.son this may generate conflicts with your version some point and may be the reason you see the error. 

So in order to avoid conflict and use demo code sample "AS-IS" you'll either have the choice to import a v1.5.0 code version in your app, under the .api folder

apifolder.png

or keep your existing v1.7.0 version and make a double-check to make sure any piece of code you may have borrowed from demo sample is pointing to the right version, especially pbiviz.json

pbiviz.png

 

and tsconfig.json
tsconfig.png

 

Thank you very much for your answer, that's something I didn't consider.

 

The problem was fixed when I added the barChart.ts to the tsconfig.json "files" member. I missed that I have to add everything to that file, as I'm pretty new to TypeScript. 

@ConnectedRoman,

 

Glad to hear that you've solved this problem. You may help mark it as answer. Your contribution is highly appreciated.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.