Closed rbudnar closed 3 years ago
I think this is probably better suited to the main repo, so I'm closing this and reposting there.
@rbudnar @ErjanGavalji @darind @jasssonpet @paynechu
I have the same problem with NativeScript Angular projects. Regular plan JavaScript projects word as expected but with Angular I get the generated code not found. I think I see the issue, if you look in the debug console the path the source files has app/app
in it when it should be src/app
for example with the HelloWorld project the vscode debugger says the path is:
e:/my-projects/ns-angular-project/app/app/item/item-detail.component.ts
when it should be:
e:/my-projects/ns-angular-project/src/app/item/item-detail.component.ts
I am trying to look through the extension source code to fix it but haven't figured it out yet. Does anyone have any ideas?? Thanks.
@rbudnar @ErjanGavalji @darind @jasssonpet @paynechu I have the same problem with NativeScript Angular projects. Regular plan JavaScript projects word as expected but with Angular I get the generated code not found. I think I see the issue, if you look in the debug console the path the source files has
app/app
in it when it should besrc/app
for example with the HelloWorld project the vscode debugger says the path is:e:/my-projects/ns-angular-project/app/app/item/item-detail.component.ts
when it should be:e:/my-projects/ns-angular-project/src/app/item/item-detail.component.ts
I am trying to look through the extension source code to fix it but haven't figured it out yet. Does anyone have any ideas?? Thanks.
I figured it out and fixed it! 😃 I am going to submit a pull request. I added a check for an "angular.json" file in the base of the
project in order to determine if it is an Angular based project, if it is the appDirPath
is changed to src
from app
. For other projects it is left as "app" because plain JavaScript projects were working fine already.
I can't believe what I was missing not being able to debug directly in my source files in vscode with NativeScript Angular projects! This is going to save me so much time and aggravation without needing to console.log everything.
Update Here is the pull request I submitted #279. It works great for me now and if you want to give it a try I'll post a link to share a build of the extension. All you have to do is go to the extension menu in vscode and click "install from vsix file" then choose the extension file downloaded from here..
Environment Provide version numbers for the following components (information can be retrieved by running
tns info
in your project folder or by inspecting thepackage.json
of the project):NativeScript CLI: 7.0.8
7.0.0
Here's my package.json (default for new project)
``` { "name": "@nativescript/template-hello-world-ng", "main": "main.js", "version": "7.0.2", "author": "NativeScript TeamDescribe the bug
Breakpoint debugging no longer works when upgrading to NS7. I see the following when setting a breakpoint in VS code:![image](https://user-images.githubusercontent.com/1072625/94015242-37a6d180-fd72-11ea-8534-42c0d77152ed.png)
This was in a brand new sample app as well as after attempting to upgrade my current app.
To Reproduce
ns create sampleapp --ng
Expected behavior We should be able to debug NS7 applications.
Sample project
Run
ns create sampleapp --ng
with the updated CLI.Additional context
I'm not sure if this the right place for this issue, since it might be something webpack related. My apologies if so.