Ricky
Ricky

Reputation: 21

VSCode > Unable to find corresponding JS when running typescript file

Can someone help me out please, if I miss anything on this? I'm getting an error where it cannot find the corresponding JS File using VSCode.

I'm just a beginner in typescript. Many thanks in advance.

My launch.json looks like this.

"configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "console": "integratedTerminal",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "preLaunchTask": "tsc: build - tsconfig.json",
            "program": "${workspaceFolder}/src/index.ts",
            "outFiles": [
                "${workspaceFolder}/build/*.js"
            ]
        }
    ]

enter image description here

Upvotes: 0

Views: 85

Answers (1)

Ricky
Ricky

Reputation: 21

Yea, sorry about this. I got a chance to answer my own question ^ ..

The reason is in my tsconfig.json -> sourceMap is NOT defined, you need to add and set it to true.

Upvotes: 1

Related Questions