NativeScript / NativeScript

⚡ Empowering JavaScript with native platform APIs. ✨ Best of all worlds (TypeScript, Swift, Objective C, Kotlin, Java, Dart). Use what you love ❤️ Angular, Capacitor, Ionic, React, Solid, Svelte, Vue with: iOS (UIKit, SwiftUI), Android (View, Jetpack Compose), Dart (Flutter) and you name it compatible.
https://nativescript.org
MIT License
24.28k stars 1.64k forks source link

XCode12 breaks debug of network traffic in Chrome Devtools #8966

Closed cjohn001 closed 4 years ago

cjohn001 commented 4 years ago

Hello together, since migration to XCode12 (NS7 project) I am not able to debug my network traffic with Chrome DevTools on IOS anymore. I build a simple app attached below which sends some http requests. If debugging the app on android, the chrome network tap shows the send packages as expected (hence I have no configuration problem with chrome). When debugging on IOS, the chrome network tap stays empty. In the attached demo app, I do no get error messages on the console. However, In the app I am working on, I am seeing the following error, which I first thought might be related. However, as the demo app does not show this error it is not the root cause. Also I need to mention that the bug appears with both ios runtimes (v8 and tns-ios)

CONSOLE WARN Loading inspector modules failed: Error: Could not find module 'inspector_modules.js'. Computed path '/Users/cjohn/Library/Developer/CoreSimulator/Devices/111F27BA-C222-47F9-B25D-2ED4E2D524A3/data/Containers/Bundle/Application/C0763E30-5EF9-4CEF-B210-A08E5B992C5D/mnd.app/app/tns_modules/inspector_modules.js'. NativeScript debugger attached.

Environment of the app I am developing:

Environment

Expected behavior I can debug as network traffic

Additional context I recreated the ios simulator runtimes for different targets like ios 14, 13.5, 11.4, 11.2 the behavior is exactly the same on each deployment target.

Demo Code: networkbug.zip

NathanWalker commented 4 years ago

You can restore network tab (and elements tab) in chrome devtools for iOS by making this change in webpack.config.js:

if (platform === 'ios' && !areCoreModulesExternal && !testing) {
  entries['tns_modules/inspector_modules'] = 'inspector_modules';
}

The conditional is less important than the entries - just find inspector_modules in your webpack.config and make that adjustment and should work again. There's a remaining issue where tapping on the network request disconnects the socket we're still looking into. Once fully resolved we'll update @nativescript/webpack plugin to contain this modification and close this ticket.

cjohn001 commented 4 years ago

Great, this works

razliberman-bv commented 3 years ago

Hi, Has the remaining issue been resolved (the disconnected socket issue)? it's still happening to me, but it seems that the ticket is closed. thanks.

SmailHammour commented 3 years ago

@NathanWalker How can we fix this in NS8?

AchrafBardan commented 3 years ago

Still not working, crashing with xcode 12.

twickstrom commented 2 years ago

can restore network tab (and elements tab) in chrome devtools for iOS by making this change in webpac

Can you post an example webpack.config.js, this does not seem to work for me