- VSCode Version: 1.46.1
- OS Version: Ubuntu 18.04
Steps to Reproduce:
- $ git clone git@github.com:Sir-hennihau/node-mongo-typescript-docker-setup.git
- $ git checkout df02470621e5599746477f1614bdb140e14e11aa
- $ cd node-mongo-typescript-docker-setup
- $ docker-compose up
- Attach debugger (config is included)
- Check "Loaded Scripts" section
Does this issue occur when all extensions are disabled?: Yes

I'm trying to develop with this stack: NodeJS, Docker ( + Docker-Compose), TypeScript and VSCode. But the debugger will not work properly.
There seems still to be a problem with using the remoteRoot configuration within launch.json (I need it in another project, the linked one is just an example repo) and TypeScript source maps. As you can see in the screenshot, the loaded script in the debugger looks way different from the original one. This gets even messier in bigger files.
According to this statement, there should have been a fix to this behaviour in 2016 already, if I'm correct? So I'm curious what my issue could be here or if it just wasn't fixed yet?
// launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "attach",
"port": 9229,
"localRoot": "${workspaceFolder}",
"remoteRoot": "/app"
}
]
}
// I also tried setting "sourceMaps": true, but it didn't change anything
# Dockerfile
FROM node:14-alpine
WORKDIR /app
COPY package*.json ./
RUN npm i
COPY . .
EXPOSE 3000
EXPOSE 9229
CMD ["npm", "run", "dev"]
# docker-compose.yml
version: "3"
services:
node-app:
build: .
volumes:
- .:/app
- /app/node_modules
ports:
- 3000:3000
- 9229:9229
// index.ts
import express from "express";
const app = express();
const PORT = 3000;
app.get("/", (req, res) => {
res.send("hello world <333.");
});
app.listen(PORT, () => {
console.log(`App listening on ${PORT}`);
});
// tsconfig.json
{
"compilerOptions": {
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"inlineSourceMap": true, // <--- Also tried using the "sourceMap: true" property instead or without any sourcemap config, but no success here
"module": "commonjs",
"outDir": "build",
"skipLibCheck": true,
"strict": true,
"target": "ESNext"
}
}
// package.json
"scripts": {
"dev": "nodemon --exec 'node --inspect=0.0.0.0:9229 --require ts-node/register source/index.ts'"
}
fyi: when you don't pass a remoteRoot value, the problem does not occur (but certain folder structures will not be debuggable then).
Steps to Reproduce:
Does this issue occur when all extensions are disabled?: Yes

I'm trying to develop with this stack: NodeJS, Docker ( + Docker-Compose), TypeScript and VSCode. But the debugger will not work properly.
There seems still to be a problem with using the remoteRoot configuration within launch.json (I need it in another project, the linked one is just an example repo) and TypeScript source maps. As you can see in the screenshot, the loaded script in the debugger looks way different from the original one. This gets even messier in bigger files.
According to this statement, there should have been a fix to this behaviour in 2016 already, if I'm correct? So I'm curious what my issue could be here or if it just wasn't fixed yet?
fyi: when you don't pass a remoteRoot value, the problem does not occur (but certain folder structures will not be debuggable then).