Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

How to run and debug the custom visuals through visual studio code for power bi

Hi,

 

Developed the custom visuals in power bi using visual studio code with d3.js and dom javascripts. But am not able to debug the code line by line and see the data flow in it. Done the code changes in 'visual.ts' file. Did configuration changes in 'tsconfig.json' & 'launch.json' but not able to debug the code.  I have tried with extensions in visual studio code but not able to debug.

If there are any other possibilities or ways to debug the code let me know.

I have mentioned the ways i have tried changes in 'tsconfig.json' & 'launch.json'  provided the structure below for reference.

launch.json

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "preLaunchTask": "tsc: build - tsconfig.json", // ADD
            "request": "launch",
            "name": "Launch Program",
            "skipFiles": [
                "⟨node_internals⟩/**"
            ],
            "program": "${workspaceFolder}/visual.ts",
            "outFiles": [
                "${workspaceFolder}/lib/**/*.js" // CHANGE "${workspaceFolder}/**/*.js"
            ]
        }
    ]
}
tsconfig.json
{
    "compilerOptions": {
        "allowJs": false,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "target": "ES2020",
        "sourceMap": true,
        "outDir": "out",
        "moduleResolution": "node",
        "declaration": true,
        "lib": [
            "ES2020",
            "dom"
        ]
    },
    "files": [
        "./src/visual.ts"
    ]
}
 
It would be helpful to know the ways of debugging the code

2 Replies