Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Version 0.0.30 components can't be debug bug #110

Closed
six006 opened this issue Oct 6, 2016 · 13 comments
Closed

Version 0.0.30 components can't be debug bug #110

six006 opened this issue Oct 6, 2016 · 13 comments

Comments

@six006
Copy link

six006 commented Oct 6, 2016

The page can't be debug,
1

@mhartington
Copy link
Contributor

@six006 please do not delete the issue template. Update your issue with the issue template and the info for it.

@jgw96
Copy link
Contributor

jgw96 commented Oct 6, 2016

Hello, thanks for opening an issue with us! Would you mind giving a little more info on what exactly is happening here? I was able to put in breakpoints fine in my testing apps.

@six006
Copy link
Author

six006 commented Oct 6, 2016

I give a test demo ,set breakpoint at the login method ,but when submit login button,it can't stop at the breakpoint !
1

@six006
Copy link
Author

six006 commented Oct 6, 2016

Thanks ,It can be debug all *.ts files by chrome debugger plugin for vscode,but can't be debug in chrome browser !
1

@jgw96
Copy link
Contributor

jgw96 commented Oct 6, 2016

Thanks! So im getting closer to figuring out what is going on here, breakpoints are working, but the line numbers seem to be "wonky". If i put a breakpoint on two different methods in my test project, click a button to call that method the breakpoint, the debugger stops on a breakpoint, but seems to be stopping on the wrong one.

@Kobzol
Copy link

Kobzol commented Oct 6, 2016

I recently noticed that ts sourcemaps were behaving weirdly in Chrome. It's a long shot, but try it with Disable cache: on in Developer Network panel.

@cleever
Copy link

cleever commented Oct 7, 2016

@Kobzol Disable cache is always on in my environment. So, isn't that.
In the previous ionic (2.0.0-beta.11) in the same Chrome version, sourcemaps debugging is working very well.

@marcocarosi
Copy link

I guess this is the right thread concerning the issue with sourcemaps causing typescript breakpoints working weirdly, and step-by-step sometimes jumping to the js bundle.

I am experiencing the same, and this is the setup I am using:

  • app-scripts upgraded to the latest ( @ionic/[email protected] )
  • visual studio code, (using Cordova Tools extension)
  • emulated iOS over Mac OS X (Xcode 7.3.1)

Various folks have posted this issue in other threads (#32 and ionic-team/ionic-framework#8292).

Again, with ionic framework beta breakpoints were working flawlessly using the same setup.

@jmesa-sistel
Copy link

jmesa-sistel commented Oct 11, 2016

I have tested pull request 126 and now I can debug properly.

Please merge it for the next version

Edit:
I am debugging in the device using livereload (ionic run android -l) but I have had to hack the config.js to create a dev bundle because "ionic run" create a prod build. So hacking config.js & using pull request 126 I can debug properly in VS Code with Cordova Tools using Attach to running android on device

Edit2:
Notice that if you run "ionic run android -l" the watch process is not started. So my trick is execute:
ionic run android -l
q (quit)
ionic serve
Now debug in the device
But I have problems (cordova is not defined)

@jmesa-sistel
Copy link

jmesa-sistel commented Oct 11, 2016

To be able to debug on device we need that

  • Merge pull request 126 (this is false, see edit)
  • "ionic run android -l" generate a dev build , start the live reload server and start the watch process.

Thanks

At now I have to do to much tricks to get it working:
ionic run android -l
In another console:
ionic serve -p 1234 -r 1235

Close android app and restart the app
Now I can debug and when I change the code the live reload works fine.

Edit:
After more testing the sourcemaps are not well generated when you are debugging a ts sometimes you jump into the js file, so pull 126 does not fix the issue.

To enable the watch process using "ionic run ...." I have modified my package.json
"run:before": "build" => "run:before": "watch"

@jgw96
Copy link
Contributor

jgw96 commented Oct 12, 2016

With the latest master i can happily report that this has been fixed! Breakpoint line numbers now line up exactly like they should. Thanks everyone!

@jgw96 jgw96 closed this as completed Oct 12, 2016
@jmesa-sistel
Copy link

jmesa-sistel commented Oct 13, 2016

Are you sure?
I have created a new project: ionic start MyIonic2Project tutorial --v2
Then I download and compiled the last master ionic-app-scripts
Copy folders bin, config & dist from compiled last ionic-app-scripts to C:\Web\MyIonic2Project\node_modules@ionic\app-scripts
Execute: ionic serve
I have the next error:

unable to find C:\Web\MyIonic2Project\src\app\main.dev.ts
(node:5372) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Could not resolve './app.module' from C:\Web\MyIonic2Project\src\app\main.dev.ts

Edit:
I have tested before and after update package.json from app-scripts (ncu -a && npm install)

Edit2:
Added a comment in the commit which broke "ionic serve"
commit

@jmesa-sistel
Copy link

Finally I can debug with latest version!!!

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

No branches or pull requests

7 participants