2
votes

Steps to reproduce: 1. Created new project from https://github.com/driftyco/ionic-starter-super 2. run `ionic run android`` 3. use chrome://inspect to debug

There is no ts and debug is not working - see attached enter image description here

Here is what I'm using: Cordova CLI: 6.4.0 Ionic Framework Version: 2.0.0-rc.4 Ionic CLI Version: 2.1.18 Ionic App Lib Version: 2.1.9 Ionic App Scripts Version: 0.0.48 ios-deploy version: 1.9.0 ios-sim version: 5.0.13 OS: macOS Sierra Node Version: v6.9.2 Xcode version: Xcode 8.2.1 Build version 8C1002

1

1 Answers

3
votes

I managed to find out what was causing the problem and how to solve it. The problem was that when you're remote debugging on an android device, Chrome debugger cannot access the source map file on the device. The solution/fix is to include the source map inline. To do this I:

added the below to package.json in the root project directory

"config": {
"ionic_bundler": "webpack",
"ionic_source_map_type": "#inline-source-map"
},

This is to make the webpack to add source maps inline changed tsconfig.js line

"sourceMap": true,

to

"sourceMap": false

This is to disable typescript to create source map file since this is done by webpack.

After this change everything seems to be working fine