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.

Debugging Breakpoints not hit in mono repo with libraries

See original GitHub issue

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes, it was running before. Don’t know the exact version (angular 10)

Description

Can’t debug into library code with Visual Studio Code or Chrome Debugger. Breakpoints in the app-component.ts are hit but breakpoints in injected service don’t. In previous versions of angular it was possible.

Found an stackoverflow article with the same problem, but without a solution / answer: https://stackoverflow.com/q/67580325/5703479

🔬 Minimal Reproduction

Sample repo: https://github.com/cluen/ng-debug-library

> ng new ng-debug-library
> ng g library @lib-core/components
> ng b @lib-core/components --watch

add test-method to component.service.ts (e.g. console.log(1)) , 
inject and call test-method in app-component.ts

add breakpoint to app-component.ts method call, 
add breakpoint to component.service.ts content

in a different terminal
ng s

launch via visual studio code: F5 (launch.json will be autogenerated, edited content below)
{
  // Verwendet IntelliSense zum Ermitteln möglicher Attribute.
  // Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen.
  // Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "type": "pwa-chrome",
      "request": "launch",
      "name": "Launch Chrome against localhost",
      "url": "http://localhost:4200",
      "webRoot": "${workspaceFolder}",
      "sourceMaps": true,
    }
  ]
}

🌍 Your Environment



     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 11.2.13
Node: 12.16.1
OS: win32 x64

Angular: 11.2.14
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1102.13
@angular-devkit/build-angular   0.1102.13
@angular-devkit/core            11.2.13
@angular-devkit/schematics      11.2.13
@angular/cli                    11.2.13
@schematics/angular             11.2.13
@schematics/update              0.1102.13
ng-packagr                      11.2.4
rxjs                            6.6.7
typescript                      4.1.5

Anything else relevant?

Chrome: Version 90.0.4430.212 Operating System: Windows Visual Studio Code Version: 1.56.2 Debugger for chrome: v4.12.12

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8

github_iconTop GitHub Comments

2reactions
cluencommented, May 26, 2021

@alan-agius4 Thank you very very much. You made my day. There were wrong / direct file imports in our libraries.

Found them with the following regex: ^import([a-zA-Z\{\} ]*)'projects

0reactions
angular-automatic-lock-bot[bot]commented, Jun 26, 2021

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot step into other open projects to debug
Putting a breakpoint on the reference to the Client inside the front-end, the breakpoint is hit when expected, but stepping into the method...
Read more >
vscode debug vue-cli app cant set breakpoints in vscode
Is there a reason why? The project is a lerna mono repo so I pull in code from packages/components & packages/library also.
Read more >
Debugging with Visual Studio for Mac - Microsoft Learn
Visual Studio for Mac uses the Mono Soft Debugger to debug managed (C# ... When you hit a breakpoint, the code will be...
Read more >
Debug external code | JetBrains Rider Documentation
External-source debugging is enabled by default. If you want the debugger to ignore library code, you ...
Read more >
Debugging Reactive Streams in Spring 5 - Baeldung
The problem is, of course, when things fall apart in production - debugging the implementation of a 3rd party library you have no...
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