question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VS Code debugging Typescript - breakpoints hit randomly

See original GitHub issue

I’m having a problem with typescript debugging in VS Code: breakpoints hit randomly. I assume there’s something wrong with source-maps, but can’t figure out what.

It worked as expected up until @quasar/app v1.8.10. But versions 1.9.0 and higher break debugging (including v2.0.0 and v2.0.1 with new quasar.conf.js). I tried no-transpiling, removing IE11 - no luck.

To Reproduce

  1. Create project with Quasar CLI:

    1. quasar create .
    2. SCSS
    3. Auto import
    4. All features selected:
    • ESLint (recommended)
    • TypeScript
    • Vuex
    • Axios
    • Vue-i18n
    1. Composition API
    2. ESLint preset: Prettier
    3. Yarn
  2. Start quasar: quasar dev

  3. Launch Firefox debugging with the following launch.json:

    "version": "0.2.0",
    "configurations": [
        {
            "name": "Firefox",
            "type": "firefox",
            "request": "launch",
            "reAttach": true,
            "url": "http://localhost:8080/",
            "webRoot": "${workspaceFolder}/src",
            "pathMappings": [
                {
                    "url": "webpack:///src/",
                    "path": "${webRoot}"
                }
            ]
        }
    ]
  1. Add breakpoint in CompositionComponent.vue on line 24:
function useClickCount() {
  const clickCount = ref(0);
  function increment() {
    clickCount.value += 1 // line 24
    return clickCount.value; // line 25
  }

  return { clickCount, increment };
}
  1. Click on ExampleComponent (in browser)
  2. Breakpoint on line 24 is hit - good
  3. Press F10 (step over) - debugger goes to line 30 instead of line 25.

It sometimes works as expected when the browser is reloaded, but then it acts up again.

Expected behavior Debugger should go line by line.

Platform

VS Code Version: 1.46.1 (user setup) Commit: cd9ea6488829f560dc949a8b2fb789f3cdc05f5d Date: 2020-06-17T21:13:20.174Z Electron: 7.3.1 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 10.0.17763

Debugger for Firefox v2.9.0

@quasar/cli - 1.1.0

package.json (not edited after quasar create):

"scripts": {
    "lint": "eslint --ext .js,.ts,.vue ./",
    "test": "echo \"No test specified\" && exit 0"
  },
  "dependencies": {
    "@quasar/extras": "^1.0.0",
    "@vue/composition-api": "^0.6.4",
    "axios": "^0.18.1",
    "core-js": "^3.6.5",
    "quasar": "^1.0.0",
    "vue-i18n": "^8.0.0"
  },
  "devDependencies": {
    "@quasar/app": "^2.0.0",
    "@types/node": "^10.17.15",
    "@typescript-eslint/eslint-plugin": "^3.3.0",
    "@typescript-eslint/parser": "^3.3.0",
    "babel-eslint": "^10.0.1",
    "eslint": "^6.8.0",
    "eslint-config-prettier": "^6.9.0",
    "eslint-loader": "^3.0.3",
    "eslint-plugin-vue": "^6.1.2"
  },
  "browserslist": [
    "ie >= 11",
    "last 10 Chrome versions",
    "last 10 Firefox versions",
    "last 4 Edge versions",
    "last 7 Safari versions",
    "last 8 Android versions",
    "last 8 ChromeAndroid versions",
    "last 8 FirefoxAndroid versions",
    "last 10 iOS versions",
    "last 5 Opera versions"
  ],
  "engines": {
    "node": ">= 10.18.1",
    "npm": ">= 6.13.4",
    "yarn": ">= 1.21.1"
  }

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
webnoobcommented, Jul 8, 2020

Fixed in @quasar/app v2.0.2

2reactions
mroescommented, Jul 1, 2020

Thank you TimTK17 for describing the problem and thank you webnoob and IlCallo for the resolution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Code breakpoints jump to other lines - Stack Overflow
1. This usually happens as the line of code you are trying to break on cannot be reached directly by the break-point. ·...
Read more >
Debug Node.js Apps using Visual Studio Code
The Visual Studio Code editor includes Node.js debugging support. Set breakpoints, step-in, inspect variables and more.
Read more >
How to debug Jest tests with VSCode - Matt Mazzola - Medium
Devtools does stop executing for you; however, because the files that your test are in have not been loaded yet you cannot set...
Read more >
Debugging in VS Code suddenly stopped working
Closing the file, the folder, VS Code itself, reopening it and trying again;; Uninstalling and reinstalling the julia extension;; Uninstalling and reinstalling ...
Read more >
Debug ASP.NET Core Blazor WebAssembly - Microsoft Learn
Hit breakpoints during app startup before the debug proxy is running. ... Visual Studio Code users require the following extensions:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found