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
Can't get TypeScript debugging to work to hit breakpoint. #371
Comments
@mikepaggi, debugging react-native apps written in typescript doesn't work out of the box and ususally requires some additional steps to get it working. In short the steps are:
Also, since debugging ts is heavily depends on project's configuration, It'd be really great if you could provide a project configuration (tsconfig.json, locations of source files) or a sample minimal app, where the problem exists Also linking #328 as it might be relevant |
@vladimir-kotikov yup I understand and I have my tsconfig.json configured since the beginning and I've added it below. Any other files you want to see?
|
I might of messed up that JSON embedding....the embedding in github is a bit poor of a UX.. |
How are you compiling your typescript? And have you made sure to specify a custom transformer as mentioned at http://www.reactnative.tools/tutorials/2016/09/20/reactnative-ts to make sure that the sourcemaps are carried along with the rest of the bundling process? |
Upd.: the transformer needs to be installed from github repo ( |
so i added the transformer that @vladimir-kotikov mentioned from that specific version. how do i know if it's running? was there anything else to do but install it? i want to setup so the debugger in vscode starts it up as part of the initial command to run the react native project on the simulator. do i need to modify anything there as well? just doesn't feel like the breakpoints are hitting still yet... |
Yep, you'll need to follow the other instructions from reactnative-ts tutorial, in particular to get transformer do its job you'll need to run standalone react-native packager with After running the packager you'll need to use "Attach to packager" launch configuration (rather than "Debug iOS"/"Debug Android") to start debug session. That's basically all. After these steps breakpoints should work in ts/tsx files.
That's tricky, but as a quick check, you can try to search ts/tsx filenames (including extension) in downloaded source map (e.g. at |
@vladimir-kotikov when you say attach to the packager for debugging does that mean i need to start up a session in terminal for react native and this will attach onto it? i haven't used this before. otherwise i was wondering how do you apply the --transformer flags and location of the module giving this. |
@MSLaguana i'm compiling my typescript in vscode using command + shift + b keyboard commands. I'm gathering i need to do what @vladimir-kotikov has mentioned but a bit confused on how to get started up with the attach to packager. |
@mikepaggi, sorry, I was unclear. Yes, exactly, you need to start react-native packager in a separate console session with |
@vladimir-kotikov ok that's what i thought. it would be nice if this was able to be customized as part of the vscode iOS / Android debug session though :-) we can close this out. |
@mikepaggi, I agree with you. Ideally i'd like to have packager arguments configurable via some parameter in |
Actual Behavior
Expected Behavior
Software versions
Outputs (Include if relevant)
Getting exponent dependecy.
######### Checking react native is correctly setup. This may take a while... ##########
Checking if the correct react native is installed..
######### Starting Packager ##########
######### Executing command: react-native start --port 8081 ##########
Scanning 661 folders for symlinks in /Users/mikepaggi/Projects/BrewLigan_RN/node_modules (17ms)
┌────────────────────────────────────────────────────────────────────────────┐
│ Running packager on port 8081. │
│ │
│ Keep this packager running while developing on any JS projects. Feel │
│ free to close this tab and run your own packager instance if you │
│ prefer. │
│ │
│ https://github.com/facebook/react-native │
│ │
└────────────────────────────────────────────────────────────────────────────┘
Looking for JS files in
/Users/mikepaggi/Projects/BrewLigan_RN
[12/23/2016, 5:28:31 PM] HMR Server listening on /hot
React packager ready.
######### Packager started. ##########
[12/23/2016, 5:28:31 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios
[12/23/2016, 5:28:31 PM] Initializing Packager
[12/23/2016, 5:28:31 PM] Building in-memory fs for JavaScript
[12/23/2016, 5:28:31 PM] Building in-memory fs for JavaScript (104ms)
[12/23/2016, 5:28:32 PM] Building Haste Map
[12/23/2016, 5:28:32 PM] Building Haste Map (375ms)
[12/23/2016, 5:28:32 PM] Initializing Packager (531ms)
[12/23/2016, 5:28:32 PM] Transforming files
[12/23/2016, 5:28:40 PM] Transforming files (8584ms)
######### The Bundle Cache was prewarmed. ##########
[12/23/2016, 5:28:41 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios (9759ms)
[12/23/2016, 5:28:54 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false
[12/23/2016, 5:28:54 PM] Transforming files
[12/23/2016, 5:28:54 PM] Transforming files (243ms)
[12/23/2016, 5:28:54 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false (350ms)
[12/23/2016, 5:29:04 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false
[12/23/2016, 5:29:04 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false (15ms)
[12/23/2016, 5:29:04 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false
[12/23/2016, 5:29:04 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false (14ms)
Starting custom debugger by executing: echo A debugger is not needed: "/Users/mikepaggi/Projects/BrewLigan_RN"
[12/23/2016, 5:29:05 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false
[12/23/2016, 5:29:05 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false (15ms)
[12/23/2016, 5:29:05 PM] Requesting bundle bundle_url: /index.ios.map?platform=ios&dev=true&minify=false
[12/23/2016, 5:29:05 PM] Requesting bundle bundle_url: /index.ios.map?platform=ios&dev=true&minify=false (52ms)
[12/23/2016, 5:29:08 PM] Processing asset request asset: app/assets/welcome_beer_background.png
[12/23/2016, 5:29:08 PM] Processing asset request asset: app/assets/welcome_beer_background.png (3ms)
[12/23/2016, 5:29:13 PM] Processing asset request asset: node_modules/react-native-router-flux/src/back_chevron.png
[12/23/2016, 5:29:13 PM] Processing asset request asset: node_modules/react-native-router-flux/src/back_chevron.png (2ms)
[12/23/2016, 5:30:28 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false&hot=true
[12/23/2016, 5:30:28 PM] Transforming files
Starting custom debugger by executing: echo A debugger is not needed: "/Users/mikepaggi/Projects/BrewLigan_RN"
[12/23/2016, 5:30:36 PM] Transforming files (7414ms)
[12/23/2016, 5:30:36 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false&hot=true (7647ms)
[12/23/2016, 5:30:36 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false&hot=true
[12/23/2016, 5:30:36 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false&hot=true (27ms)
[12/23/2016, 5:30:36 PM] Requesting bundle bundle_url: /index.ios.map?platform=ios&dev=true&minify=false&hot=true
[12/23/2016, 5:30:36 PM] Requesting bundle bundle_url: /index.ios.map?platform=ios&dev=true&minify=false&hot=true (55ms)
[12/23/2016, 5:30:40 PM] HMR Client connected
[12/23/2016, 5:30:40 PM] Processing asset request asset: app/assets/welcome_beer_background.png
[12/23/2016, 5:30:40 PM] Processing asset request asset: app/assets/welcome_beer_background.png (3ms)
[12/23/2016, 5:34:10 PM] HMR Server detected file change
[12/23/2016, 5:34:10 PM] HMR Server detected file change
[12/23/2016, 5:34:10 PM] HMR Server detected file change
[12/23/2016, 5:34:10 PM] HMR Server detected file change
[12/23/2016, 5:34:10 PM] HMR Server detected file change
[12/23/2016, 5:34:10 PM] HMR Server detected file change
[12/23/2016, 5:34:10 PM] HMR Server detected file change
[12/23/2016, 5:34:11 PM] Transforming files
[12/23/2016, 5:34:11 PM] Transforming files (0ms)
[12/23/2016, 5:34:11 PM] Transforming files
[12/23/2016, 5:34:11 PM] Transforming files (0ms)
[12/23/2016, 5:34:11 PM] Transforming files
[12/23/2016, 5:34:11 PM] Transforming files (0ms)
[12/23/2016, 5:34:11 PM] HMR Server sending update to client
[12/23/2016, 5:34:11 PM] HMR Server sending update to client
[12/23/2016, 5:34:11 PM] HMR Server sending update to client
[12/23/2016, 5:34:11 PM] Transforming files
[12/23/2016, 5:34:11 PM] Transforming files (0ms)
[12/23/2016, 5:34:11 PM] Transforming files
[12/23/2016, 5:34:11 PM] Transforming files (0ms)
[12/23/2016, 5:34:11 PM] HMR Server sending update to client
[12/23/2016, 5:34:11 PM] HMR Server sending update to client
######### Attaching to running React Native packager ##########
######### Checking react native is correctly setup. This may take a while... ##########
Checking if the correct react native is installed..
######### Packager is already running. ##########
[12/23/2016, 5:41:41 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios
[12/23/2016, 5:41:41 PM] Transforming files
[12/23/2016, 5:41:41 PM] Transforming files (193ms)
######### The Bundle Cache was prewarmed. ##########
[12/23/2016, 5:41:41 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios (298ms)
[12/23/2016, 5:41:51 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false
[12/23/2016, 5:41:51 PM] Transforming files
[12/23/2016, 5:41:51 PM] Transforming files (250ms)
[12/23/2016, 5:41:51 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false&hot=true
[12/23/2016, 5:41:51 PM] Transforming files
[12/23/2016, 5:41:52 PM] Transforming files (173ms)
Starting custom debugger by executing: echo A debugger is not needed: "/Users/mikepaggi/Projects/BrewLigan_RN"
[12/23/2016, 5:41:52 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false&hot=true
Starting custom debugger by executing: echo A debugger is not needed: "/Users/mikepaggi/Projects/BrewLigan_RN"
[12/23/2016, 5:41:52 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false (577ms)
[12/23/2016, 5:41:52 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false&hot=true (327ms)
[12/23/2016, 5:41:52 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false&hot=true (162ms)
[12/23/2016, 5:41:53 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false&hot=true
[12/23/2016, 5:41:53 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false&hot=true (23ms)
[12/23/2016, 5:41:53 PM] Requesting bundle bundle_url: /index.ios.map?platform=ios&dev=true&minify=false&hot=true
[12/23/2016, 5:41:53 PM] Requesting bundle bundle_url: /index.ios.map?platform=ios&dev=true&minify=false&hot=true (64ms)
[12/23/2016, 5:41:56 PM] HMR Client connected
[12/23/2016, 5:41:56 PM] Processing asset request asset: app/assets/welcome_beer_background.png
[12/23/2016, 5:41:56 PM] Processing asset request asset: app/assets/welcome_beer_background.png (3ms)
[12/23/2016, 5:42:01 PM] Symbolicating
[12/23/2016, 5:42:01 PM] Transforming files
[12/23/2016, 5:42:01 PM] Transforming files (113ms)
[12/23/2016, 5:42:01 PM] Symbolicating (211ms)
Starting custom debugger by executing: echo A debugger is not needed: "/Users/mikepaggi/Projects/BrewLigan_RN"
[12/23/2016, 5:42:03 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false&hot=true
[12/23/2016, 5:42:03 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false&hot=true (16ms)
[12/23/2016, 5:42:03 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false&hot=true
[12/23/2016, 5:42:03 PM] Requesting bundle bundle_url: /index.ios.bundle?platform=ios&dev=true&minify=false&hot=true (15ms)
[12/23/2016, 5:42:03 PM] Requesting bundle bundle_url: /index.ios.map?platform=ios&dev=true&minify=false&hot=true
[12/23/2016, 5:42:03 PM] Requesting bundle bundle_url: /index.ios.map?platform=ios&dev=true&minify=false&hot=true (52ms)
[12/23/2016, 5:42:08 PM] HMR Client connected
[12/23/2016, 5:42:09 PM] Processing asset request asset: app/assets/welcome_beer_background.png
[12/23/2016, 5:42:09 PM] Processing asset request asset: app/assets/welcome_beer_background.png (2ms)
The text was updated successfully, but these errors were encountered: