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 add breakpoint, source maps issue? #328
Comments
Here's the repo that I have been using to try this extension out. |
same case, waiting for the solution. |
@kidtsunami, @owenyang0, this is something that will not work out of the box - you'll need to tweak your project to make react-native consider sourcemaps produced by typescript when generating resultant bundle. Check this article for more details: http://www.reactnative.tools/tutorials/2016/09/20/reactnative-ts . You can also use this repo: https://github.com/panarasi/ReactNativeTS as a project template that supports setting breakpoints in tsx files |
Upd.: there is a PR mhzed/react-native-sm-transformer#1, that fixes some issues that are causing extension (and debugger) to fail breakpoints validation |
Linking another relevant issue for cross-reference: #371 @MSLaguana, can we close both these issues? IMO there is nothing we can do here, unless we're not going to improve typescript support in the near future |
I'll close this for now, but if you try the steps referenced in #328 (comment) and they don't work, please do re-open the issue or file a new one so we can try to improve the situation. |
We have followed the steps in #328 (comment) and have never gotten this to work. |
Can you please try debugging, get to the point where a breakpoint is not hit, and then upload the contents of |
Sure, will try to do so this week @kidtsunami |
I've been having the same problem with breakpoints not getting set because mappings are lost. @pawsong found a workaround. Set tsconfig.json to use inlineSourceMap instead of sourceMap.
|
That's interesting, since our debugger doesn't support inline sourcemaps. I suspect that when using non-inline sourcemaps, the JS compiled from TS is having the source maps ignored rather than rolled into end result, and using inline sourcemaps might be working around that. Definitely needs some more investigation. @vladimir-kotikov are you able to look into that? |
@MSLaguana, yes, I'll investigate |
I confirm, that adding However, notice that the recipe above works only when you also have |
Hi,
No success. |
@vladimir-kotikov Same problem reported by @muccy . |
@muccy, @saeedtabrizi, thanks for reporting. I confirm that I can see the same problem after upgrading to RN 0.42. I'll investigate and let you know if there are any solutions or workarounds. |
@vladimir-kotikov Probably makes sense adding the note about it into README until resolved |
@ambientlight, Hmm, I think it's an undocumented feature so I doubt it's worth mentioning this in README. Also posting here some investigation results. The functionality that was merging existing source maps w/ ones produced by react-native packager was broken in facebook/react-native@0849f84. Since this commit packager no longer uses babel's The solution might be to reimplement this merging logic (as suggested by @alloy in facebook/react-native#7083 (comment)) in react-native's transformer but this would have some performance drawbacks, as merging process would use Also linking facebook/react-native#12705 as it's basically the same issue. |
@vladimir-kotikov which implies we need to stick with 0.41.2 for some time now? |
@vladimir-kotikov FWIW, the performance drawbacks have been negligible during iterative development. I think it was noticeable in a clean (uncached) build, but haven’t performed any profiling. |
@ambientlight, you still could try an approach w/ passing custom transformer to post-process source maps - see http://www.reactnative.tools/tutorials/2016/09/20/reactnative-ts/, "Enabling sourcemaps" section and https://github.com/panarasi/ReactNativeTS/blob/master/package.json#L8 as an example - this will work w/ react-native@0.42 but has some issues w/ 0.43 due to changes in public transformer's interface (mhzed/react-native-sm-transformer#2) @alloy, yeah, I completely agree |
@vladimir-kotikov Thanks for the suggestion. |
@vladimir-kotikov , is there any update or trick to solve problem urgently. |
Any updates on this? |
I had to switch after VS Code stopped debugging. Unfortunate. But this debugger is much better anyway. |
I've seen several statements to follow the recommendations at http://www.reactnative.tools/tutorials/2016/09/20/reactnative-ts/. That page suggests executing this command:
I don't ever use that command in my current workflow. I use this commands:
How does that article help solve the problem of debugging a React Native app in TypeScript? |
Hi @vladimir-kotikov Thanks |
@saeedtabrizi, there is no changes required for TS configuration. For the sample project you can refer to panarasi/ReactNativeTS#1 or checkout this repo directly: https://github.com/vladimir-kotikov/ReactNativeTS |
|
Confirmed TS debugging appears to be totally broken in React Native. Could not get sourcemaps working on the ReactNativeTS project referenced by @vladimir-kotikov. This thread can probably be closed until (we hope) the relevant RN repo issue is resolved. |
@lukecwilliams responded here |
Still not work, any update or docs ? |
@iShawnWang sorry for late response - if this is still actual, could you please provide a bit more info. Would be ideal if you create a new issue and provide all details asked in issue template |
Actual Behavior
"Breakpoint ignored because generated source code not found (source map problem?)"
Expected Behavior
Software versions
Outputs (Include if relevant)
[vscode-react-native] Starting React Native Packager.
[vscode-react-native] Prewarming bundle cache. This may take a while ...
[vscode-react-native] Building and running application.
[vscode-react-native] Executing command: react-native run-ios --simulator iPhone 5s --project-path ios
Found Xcode project TypescriptTest3.xcodeproj
Launching iPhone 5s (10.0)...
Building using "xcodebuild -project TypescriptTest3.xcodeproj -scheme TypescriptTest3 -destination id=E3F427C1-5B10-45B9-AE0E-313C6E72965F -derivedDataPath build"
User defaults from command line:
IDEDerivedDataPathOverride = /Users/davidhelmer/Work/React Native/TypescriptTest4/ios/build
=== BUILD TARGET RCTVibration OF PROJECT RCTVibration WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET RCTGeolocation OF PROJECT RCTGeolocation WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET RCTLinking OF PROJECT RCTLinking WITH CONFIGURATION Debug ===
Check dependencies
=== BUILD TARGET React OF PROJECT React WITH CONFIGURATION Debug ===
Check dependencies
PhaseScriptExecution Run\ Script /Users/davidhelmer/Work/React\ Native/TypescriptTest4/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Script-006B79A01A781F38006873D1.sh
cd "/Users/davidhelmer/Work/React Native/TypescriptTest4/node_modules/react-native/React"
export ACTION=build
export AD_HOC_CODE_SIGNING_ALLOWED=NO
export ALTERNATE_GROUP=staff
export ALTERNATE_MODE=u+w,go-w,a+rX
export ALTERNATE_OWNER=davidhelmer
export ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO
export ALWAYS_SEARCH_USER_PATHS=NO
export ALWAYS_USE_SEPARATE_HEADERMAPS=NO
export APPLE_INTERNAL_DEVELOPER_DIR=/AppleInternal/Developer
export APPLE_INTERNAL_DIR=/AppleInternal
export APPLE_INTERNAL_DOCUMENTATION_DIR=/AppleInternal/Documentation
export APPLE_INTERNAL_LIBRARY_DIR=/AppleInternal/Library
export APPLE_INTERNAL_TOOLS=/AppleInternal/Developer/Tools
export APPLICATION_EXTENSION_API_ONLY=NO
export APPLY_RULES_IN_COPY_FILES=NO
export ARCHS=x86_64
export ARCHS_STANDARD="i386 x86_64"
export ARCHS_STANDARD_32_64_BIT="i386 x86_64"
export ARCHS_STANDARD_32_BIT=i386
export ARCHS_STANDARD_64_BIT=x86_64
export ARCHS_STANDARD_INCLUDING_64_BIT="i386 x86_64"
export ARCHS_UNIVERSAL_IPHONE_OS="i386 x86_64"
Getting exponent dependecy.
Dependency not present. Installing it...
######### 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 647 folders for symlinks in /Users/davidhelmer/Work/React Native/TypescriptTest4/node_modules (21ms)
┌────────────────────────────────────────────────────────────────────────────┐
│ 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/davidhelmer/Work/React Native/TypescriptTest4
.[11:35:12 AM] Building Dependency Graph
[11:35:12 AM] Crawling File System
[Hot Module Replacement] Server listening on /hot
React packager ready.
[11:35:12 AM] Crawling File System (443ms)
[11:35:12 AM] Building in-memory fs for JavaScript
[11:35:13 AM] Building in-memory fs for JavaScript (508ms)
[11:35:13 AM] Building in-memory fs for Assets
[11:35:13 AM] Building in-memory fs for Assets (413ms)
[11:35:13 AM] Building Haste Map
.[11:35:13 AM] Building (deprecated) Asset Map
[11:35:14 AM] Building (deprecated) Asset Map (167ms)
[11:35:14 AM] Building Haste Map (458ms)
[11:35:14 AM] Building Dependency Graph (1874ms)
### Packager started.
[11:35:14 AM] request:/index.ios.bundle?platform=ios
[11:35:14 AM] find dependencies
...................[11:35:42 AM] request:/build/index.ios.bundle?platform=ios&dev=true&minify=false
[11:35:42 AM] find dependencies
Starting custom debugger by executing: echo A debugger is not needed: "/Users/davidhelmer/Work/React Native/TypescriptTest4"
[11:35:43 AM] request:/build/index.ios.bundle?platform=ios&dev=true&minify=false
.[11:35:44 AM] find dependencies (1970ms)
[11:35:44 AM] request:/build/index.ios.bundle?platform=ios&dev=true&minify=false (2184ms)
[11:35:44 AM] request:/build/index.ios.bundle?platform=ios&dev=true&minify=false (1068ms)
.........[11:36:04 AM] request:/build/index.ios.bundle?platform=ios&dev=true&minify=false
[11:36:04 AM] request:/build/index.ios.bundle?platform=ios&dev=true&minify=false (24ms)
Starting custom debugger by executing: echo A debugger is not needed: "/Users/davidhelmer/Work/React Native/TypescriptTest4"
......######### Stopping Packager ##########
### Packager stopped
### 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 647 folders for symlinks in /Users/davidhelmer/Work/React Native/TypescriptTest4/node_modules (38ms)
┌────────────────────────────────────────────────────────────────────────────┐
│ 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/davidhelmer/Work/React Native/TypescriptTest4
[11:44:40 AM] Building Dependency Graph
[11:44:40 AM] Crawling File System
[Hot Module Replacement] Server listening on /hot
React packager ready.
[11:44:40 AM] Crawling File System (284ms)
[11:44:40 AM] Building in-memory fs for JavaScript
[11:44:40 AM] Building in-memory fs for JavaScript (251ms)
[11:44:40 AM] Building in-memory fs for Assets
[11:44:41 AM] Building in-memory fs for Assets (201ms)
[11:44:41 AM] Building Haste Map
[11:44:41 AM] Building (deprecated) Asset Map
[11:44:41 AM] Building (deprecated) Asset Map (84ms)
### Packager started.
[11:44:41 AM] Building Haste Map (278ms)
[11:44:41 AM] Building Dependency Graph (1024ms)
[11:44:41 AM] request:/index.ios.bundle?platform=ios
[11:44:41 AM] find dependencies
[11:44:59 AM] request:/build/index.ios.bundle?platform=ios&dev=true&minify=false
[11:44:59 AM] find dependencies
Starting custom debugger by executing: echo A debugger is not needed: "/Users/davidhelmer/Work/React Native/TypescriptTest4"
[11:45:00 AM] request:/build/index.ios.bundle?platform=ios&dev=true&minify=false
[11:45:00 AM] find dependencies (1796ms)
[11:45:00 AM] request:/build/index.ios.bundle?platform=ios&dev=true&minify=false (1926ms)
[11:45:00 AM] request:/build/index.ios.bundle?platform=ios&dev=true&minify=false (761ms)
[11:45:01 AM] request:/build/index.ios.bundle?platform=ios&dev=true&minify=false
[11:45:01 AM] request:/build/index.ios.bundle?platform=ios&dev=true&minify=false (15ms)
[11:45:01 AM] request:/build/index.ios.map?platform=ios&dev=true&minify=false
[11:45:01 AM] request:/build/index.ios.map?platform=ios&dev=true&minify=false (59ms)
[11:45:22 AM] request:/build/index.ios.bundle?platform=ios&dev=true&minify=false
[11:45:22 AM] request:/build/index.ios.bundle?platform=ios&dev=true&minify=false (14ms)
Starting custom debugger by executing: echo A debugger is not needed: "/Users/davidhelmer/Work/React Native/TypescriptTest4"
[11:45:22 AM] request:/build/index.ios.bundle?platform=ios&dev=true&minify=false
[11:45:22 AM] request:/build/index.ios.bundle?platform=ios&dev=true&minify=false (11ms)
[11:45:22 AM] request:/build/index.ios.map?platform=ios&dev=true&minify=false
[11:45:22 AM] request:/build/index.ios.map?platform=ios&dev=true&minify=false (57ms)
The text was updated successfully, but these errors were encountered: