0

I am working through the Power BI custom visual development tutorial by Microsoft. I have followed the steps until the "Developing the visual elements" section and have managed to generate the standard Power BI visual template via the pbiviz new visualNameHere command. It successfully compiles and works on my sample report on Power BI .

However, before I have even changed anything beyond the tutorial steps, I get an error message in Visual Studio Code that something is wrong with the automatically generated pbiviz.json file.

The error given is:

File not found (<removed>\CircleCard\.api\v1.6.0\schema.pbiviz.json))

Since the visual does compile can I just ignore this message and assume that it is a Visual Studio quirk? I am confused as to what setting is even searching for this, and why is it searching under .api\v1.6.0\ when the current api version seems to be 2.6.0.

File not found (....\CircleCard.api\v1.6.0\schema.pbiviz.json))

Sheriseology
  • 324
  • 2
  • 5
  • Just wanted to add if someone else is doing the Circle Card tutorial, the pbiviz update changed quite a few things and some steps may need to be adjusted according to this documentation. https://microsoft.github.io/PowerBI-visuals/docs/how-to-guide/migrating-to-powerbi-visuals-tools-3-0/ – Sheriseology Oct 10 '19 at 14:12

1 Answers1

2

After seeing the this question I decided to look at settings.json in the .vscode directory and found the source of all the incorrect api directories. I changed them to reference the api under ./node_modules/powerbi-visuals-api/.

That is to say in .vscode\settings.json I changed

    "json.schemas": [
    {
        "fileMatch": [
            "/pbiviz.json"
        ],            
        "url": "./.api/v1.6.0/schema.pbiviz.json"
    },
    {
        "fileMatch": [
            "/capabilities.json"
        ],            
        "url": "./.api/v1.6.0/schema.capabilities.json"
    },
    {
        "fileMatch": [
            "/dependencies.json"
        ],            
        "url": "./.api/v1.6.0/schema.dependencies.json"
    }        
] 

to...

    "json.schemas": [
    {
        "fileMatch": [
            "/pbiviz.json"
        ],            
        "url": "./node_modules/powerbi-visuals-api/schema.pbiviz.json"
    },
    {
        "fileMatch": [
            "/capabilities.json"
        ],            
        "url": "./node_modules/powerbi-visuals-api/schema.capabilities.json"
    },
    {
        "fileMatch": [
            "/dependencies.json"
        ],            
        "url": "./node_modules/powerbi-visuals-api/schema.dependencies.json"
    }        
] 

Edit: Also relevant is this answer explaining that an npm update causes the api folder generation to be different.

Sheriseology
  • 324
  • 2
  • 5