# Debugging netlify functions in vscode

**URL:** <https://answers.netlify.com/t/debugging-netlify-functions-in-vscode/42316>\
**Category:** Support\
**Tags:** lambda-functions\
**Created:** [August 10, 2021, 11:45pm UTC](https://answers.netlify.com/t/debugging-netlify-functions-in-vscode/42316 "2021-08-10T23:45:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShaCP](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/shacp/32/28321_2.png) [@ShaCP](https://answers.netlify.com/u/ShaCP)\
**Post date:** [August 10, 2021, 11:45pm UTC](https://answers.netlify.com/t/debugging-netlify-functions-in-vscode/42316/1 "2021-08-10T23:45:37Z")

</div>

trying to get netlify function debugging to work in vscode but the breakpoints don’t work.

I have this file in my root folder to create the sourcemap (since I’m using netlify-lambda to be able to use syntax such as “import”):

```nohighlight
//webpack.lambda.js
module.exports = {
  optimization: {minimize: false},
  devtool: "source-map",
  target: "node",
}

```

I have this in my package.json:

```nohighlight
  "scripts": {
    "build:lambda": "netlify-lambda build src/utilities/lambda --config ./webpack.lambda.js",
    "debug": "netlify dev --inspect"
  }

```

And this in vscode’s launch.json:

```nohighlight
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Netlify Debugging",
            "type": "pwa-node",
            "request": "launch",
            "program": "${workspaceFolder}\\node_modules\\.bin\\netlify",
            "runtimeArgs": [
                "run-script",
                "debug"
            ],
            "runtimeExecutable": "npm",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "sourceMapPathOverrides": {
                "webpack:///./*": "${workspaceFolder}/src/utilities/lambda/*",
            },
            "resolveSourceMapLocations": [
                "${workspaceFolder}/**",
                "! **/node_modules/**"
            ]
        }
    ]
}

```

I cannot get breakpoints to work though. Soon as I start debugging all breakpoints turn into “unbound breakpoints”.

I am using create-react-app. Not sure if that matters.

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [August 11, 2021, 8:05am UTC](https://answers.netlify.com/t/debugging-netlify-functions-in-vscode/42316/2 "2021-08-11T08:05:25Z")

</div>

Hi @ShaCP,

Why this doesn’t work for you in VSCode is something VSCode can answer better probably.

However, if import statements is your only requirement, you can check out `esbuild` support in Netlify CLI: [Modern, faster Netlify Functions: New bundler and JavaScript features](https://www.netlify.com/blog/2021/04/02/modern-faster-netlify-functions/). Maybe that would give you different results?
