microsoft / vscode-js-debug

A DAP-compatible JavaScript debugger. Used in VS Code, VS, + more
MIT License
1.68k stars 284 forks source link

Unbound breakpoints: We couldn't find a corresponding source location #1545

Closed cDillanb closed 1 year ago

cDillanb commented 1 year ago

Describe the bug ✅ This breakpoint was initially set in:

/home/cdillanb/AndroidStudioProjects/order_fulfillment/functions/src/generateRackImages.ts line 38 column 1

❓ We couldn't find a corresponding source location, and didn't find any source with the name generateRackImages.ts.

To Reproduce

  1. I'm running npm run debug to start inspections. The debugger attaches, but I get the error above. My typescript is being compiled into from functions/src into lib/src, which is the outDir and I have sourceMap set to true. Why am I getting unbound breakpoints?

Screenshot showing compiled lib directory. image

tsconfig.json

{
  "compilerOptions": {
    "module": "commonjs",
    "noImplicitReturns": true,
    "noUnusedLocals": false,
    "outDir": "lib",
    "sourceMap": true,
    "strict": true,
    "target": "es2017",
    "noImplicitAny": false,
    "strictNullChecks": false,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true
  },
  "compileOnSave": true,
  "include": ["src", "index.ts"]
}

launch.json

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "attach",
      "name": "Debug",
      "port": 9229,
      "trace": true
    }
  ]
}

package.json

{
  "name": "functions",
  "scripts": {
    "lint": "eslint --ext .js,.ts .",
    "build": "tsc",
    "build:watch": "tsc --watch",
    "serve": "npm run build && firebase emulators:start --only functions",
    "shell": "npm run build && firebase functions:shell",
    "start": "npm run shell",
    "dev": "cd ~/AndroidStudioProjects/order_fulfillment && firebase emulators:start --import=saved-data --export-on-exit && tsc --watch",
    "debug": "cd ~/AndroidStudioProjects/order_fulfillment && firebase emulators:start --import=saved-data --export-on-exit --inspect-functions && tsc --watch",
    "deploy": "cd functions && npm ci && npm run build && cd .. && firebase deploy --only hosting",
    "web": "cd ~/AndroidStudioProjects/order_fulfillment && flutter run -d chrome --web-renderer canvaskit --web-hostname localhost --web-port 45887",
    "logs": "firebase functions:log"
  },
  "engines": {
    "node": "16"
  },
  "main": "lib/index.js",
  "dependencies": {
    "@elastic/elasticsearch": "^8.2.1",
    "@google-cloud/pubsub": "^2.15.1",
    "@google-cloud/secret-manager": "^3.7.1",
    "@sendgrid/mail": "^7.6.0",
    "@shopify/shopify-api": "^5.0.1",
    "aws-sdk": "^2.1231.0",
    "axios": "^0.27.2",
    "body-parser": "^1.19.2",
    "cors": "^2.8.5",
    "csvtojson": "^2.0.10",
    "eslint": "^8.23.0",
    "express": "^4.17.2",
    "firebase-admin": "^11.0.1",
    "firebase-functions": "^4.2.1",
    "html-pdf-node": "^1.0.8",
    "luxon": "^1.27.0",
    "node-fetch": "^2.6.7",
    "pdf-merger-js": "^4.1.0",
    "qrcode": "^1.5.1",
    "uuid": "^8.3.2"
  },
  "devDependencies": {
    "@types/download": "^8.0.1",
    "@types/html-pdf": "^3.0.0",
    "@types/luxon": "^1.27.0",
    "@types/mime-types": "^2.1.1",
    "@types/node-fetch": "^2.6.1",
    "@types/pdfkit": "^0.12.6",
    "@types/qrcode": "^1.5.0",
    "@types/request": "^2.48.7",
    "@typescript-eslint/eslint-plugin": "^5.12.0",
    "@typescript-eslint/parser": "^5.12.0",
    "concurrently": "^7.4.0",
    "eslint-config-google": "^0.14.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-plugin-import": "^2.25.4",
    "eslint-plugin-prettier": "^4.2.1",
    "firebase-functions-test": "^0.2.0",
    "node": "^18.8.0",
    "prettier": "^2.7.1",
    "typescript": "^4.5.4"
  },
  "private": true,
  "version": "1.0.0",
  "author": "",
  "license": "ISC",
  "description": ""
}

Log File vscode-debugadapter-e6256dda.json.gz

VS Code Version: 1.75.0 Additional context Version: 1.75.0 Commit: e2816fe719a4026ffa1ee0189dc89bdfdbafb164 Date: 2023-02-01T15:29:17.766Z Electron: 19.1.9 Chromium: 102.0.5005.194 Node.js: 16.14.2 V8: 10.2.154.23-electron.0 OS: Linux x64 5.15.89-1-MANJARO Sandboxed: No

connor4312 commented 1 year ago

I'm not familiar with firebase, but it looks like your source code is not getting loaded, or you're debugging the wrong thing: looking at the log file, no scripts except for ones in node_modules are loaded in the runtime. Breakpoints will not bind until the corresponding source is loaded into the runtime.

I suggest looking some more into your firebase setup to figure out why this is. If you're sure your functions are being run, double check how you set up debugging for firebase.