Skip to content

Debugging not working with new angular projects and --bundle #232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
endarova opened this issue Jan 10, 2019 · 5 comments
Closed

Debugging not working with new angular projects and --bundle #232

endarova opened this issue Jan 10, 2019 · 5 comments

Comments

@endarova
Copy link

Environment
CLI: @rc(5.1.1)
Cross-platform modules: 5.1.1
Android Runtime: 5.1.0
iOS Runtime: 5.1.0
VSCodeExtension: v.2018.12.11.1

To Reproduce:
tns create newApp --ng
cd newApp
code .
Add "tnsArgs": ["--bundle"] in the Launch on Android task.
Run the Launch on Android task.
Set a breakpoint.
The breakpoint is grayed out and marked as unverified

It is the same for ios.
(It is working with old templates for example @5.1.0).

Expected behavior
You should be able to debug the NativeScript apps in VSCode when the --bundle flag is passed.

@endarova endarova added the bug label Jan 10, 2019
@18clans
Copy link

18clans commented Jan 17, 2019

Same issue with me.

@AhmedAzzabi
Copy link

Yes same here, the debug and hmr functinoality were fixed, in chrome debug it works fine, but the breakpoints are not working when --bundle or --hmr option are passed, and it is not ideal to switch between editor and chrome for debug.

@rosen-vladimirov
Copy link
Contributor

We've investigated this issue and it seems to happen only for Angular projects. The problem is caused by the "nativescript-dev-webpack/lazy-ngmodule-hot-loader", so in case you are not using HMR, you can safely comment the line where "nativescript-dev-webpack/lazy-ngmodule-hot-loader", is used from your webpack.config.js.
We are looking for a solution, but meanwhile you can use the above mentioned workaround.

@theunsa
Copy link

theunsa commented Feb 3, 2019

@rosen-vladimirov

... it seems to happen only for Angular projects

While a PR on this has been merged and is probably being tested, I wanted to point out that I get the same problem for a nativescript-vue app i.e. tns create newApp --vue with platform ios. Would appreciate it if the tests verified the Vue use case as well. Thanks!

Environment

  • CLI: 5.1.1
  • Cross-platform modules: 5.1.2
  • Android Runtime: 5.1.0
  • iOS Runtime: 5.1.1
  • VSCode: 1.30.2
  • NativeScript Extension for VSCode: 0.8.4

@endarova
Copy link
Author

Hi @theunsa,
Thank you for reporting the issue. We have pull request in the nativescript-dev-webpack repo that is fixing this behavior. #https://github.com/NativeScript/nativescript-dev-webpack/pull/774/files. When it is merged and released you will have to update your project's nativescript-dev-webpack plugin. Meanwhile you can try applying the same changes as in the PR to your webpack.config.js file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants