Visual studio code Debugger can't find sourcemaps with cordova and typescript

Viewed 676

I am trying to debug my Cordova App that is build using typescript in VisualStudio Code. I have external sourcemaps that are present and next to my bundle.js.

When i try to debug on my Android Device the debug console prints the error:

Could not read source map for file:///android_asset/www/bundle.js: ENOENT: no such file or directory, open 'C:\android_asset\www\bundle.js.map'

When i google for this error i get the answer that i should add resolveSourceMapLocations to the launchconfig pointing to the project folder. But that config does not exist on a launch config for cordova, only on Node.js.

I've also tried to add a pathmapping and sourceMapPathOverrides but they had no effect.

        "pathMapping" : {
            "/" : "${workspaceFolder}"
        },
        "sourceMapPathOverrides": {
            "file:///android_asset/www/*": "${workspaceFolder}/www/*"
        }

My launch config looks like this right now:

    {
        "name": "Run Android on device",
        "type": "cordova",
        "request": "launch",
        "platform": "android",
        "target": "device",
        "port": 9222,
        "sourceMaps": true,
        "cwd": "${workspaceFolder}",
        "pathMapping" : {
            "/" : "${workspaceFolder}"
        },
        "sourceMapPathOverrides": {
            "file:///android_asset/www/*": "${workspaceFolder}/www/*"
        }
    },
0 Answers
Related