0

From my terminal I run firebase emulators:start --only functions,firestore --inspect-functions.

I currently have this launch.json:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "attach",
            "name": "Typescript Functions",
            "port": 9229,
            "restart": true,
            "skipFiles": ["<node_internals>/**"],
            "outFiles": ["${workspaceFolder}/typescript-functions/lib/*.js.map"]
        }
    ]
}

My intention is to debug a server side endpoint, calling it through POSTMAN. I've been digging different documentation and guides, but I haven't had the ability to exactly find demos or guides regarding the necessary Typescript mapping.

The launch.json is inside the .vscode folder, at the root level. Then I have my typescript-functionsfolder, where inside of it I have a srcfolder with all the Typescript code.

Then, there is a libfolder where all the transpiled code exists in javascript, with their respective source maps.

enter image description here

What am I missing?

I've been reading different questions:

Functions debugging in VS Code

https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_source-maps

https://code.visualstudio.com/docs/nodejs/nodejs-debugging

https://code.visualstudio.com/docs/typescript/typescript-debugging#_mapping-the-output-location

https://code.visualstudio.com/docs/nodejs/nodejs-debugging#_source-maps

VS Code Unbound breakpoints: We couldn't find a corresponding source location

But unfortunately, haven't had the ability to find out the solution yet. I have verified, that if my code was written in JS, the debugger works as expected and stops the execution correctly, so my conclusion is that i'm basically missing the part where i'm linking the typescript source mapping, and where does the debugger need to look at.

Thanks :)

Raül
  • 137
  • 3
  • 15
  • You should modify the `"outFiles"` path accordingly. `"outFiles": ["${workspaceFolder}/typescript-functions/lib/**/*.js"]`. Additionally, ensure that you have the `"sourceMap"` option enabled in your TypeScript configuration (`tsconfig.json`). – Chanpols Jul 27 '23 at 21:22
  • Hi @Chanpols, I did try that, but still can't manage to get it to work? What else could I be missing? What other information would be useful for you to help me find out the issue? Thanks :) – Raül Aug 01 '23 at 11:34

0 Answers0