Skip to content
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

Remote Debug JS - works only DEV mode after 0.58 , but in 0.57 all good #23254

Closed
in4core opened this issue Feb 1, 2019 · 8 comments
Closed
Labels
Bug Resolution: Locked This issue was locked by the bot.

Comments

@in4core
Copy link

in4core commented Feb 1, 2019

Environment

React Native Environment Info:
System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz
Memory: 1.68 GB / 7.95 GB
Binaries:
npm: 6.7.0 - C:\Program Files\nodejs\npm.CMD
IDEs:
Android Studio: Version 3.3.0.0 AI-182.5107.16.33.5199772

Dependencies :
"dependencies": {
"react": "16.6.3",
"react-native": "0.58.3",
"react-native-gesture-handler": "^1.0.15",
"react-native-img-cache": "^1.6.0",
"react-native-section-list-get-item-layout": "^2.2.3",
"react-native-vector-icons": "^6.2.0",
"react-navigation": "^3.0.9",
"rn-fetch-blob": "^0.10.15"
},

Description

Remote Debug JS - works only DEV mode after 0.58 , but in 0.57 all good.
When starts it in Prod mode we have some errors
Cannot read property 'Constants' of null
Module AppRegistry is not a registered callable module (calling runApplication)

Reproducible Demo

@Abuitime
Copy link

Same

@darekg11
Copy link

Just leaving comment, it is also happening to me.
But seeing that not so many people reported this, do you think that this might be bound to specific 3rd module having problems with newest React-Native (0.58)?

@in4core
Copy link
Author

in4core commented Feb 25, 2019

Just leaving comment, it is also happening to me.
But seeing that not so many people reported this, do you think that this might be bound to specific 3rd module having problems with newest React-Native (0.58)?

I dont know, but i will try use clear project, without dependencies - today. But, if i think true, clear project also fail

@in4core
Copy link
Author

in4core commented Feb 25, 2019

"dependencies": {
"js-md5": "^0.7.3",
"react": "16.6.3",
"react-native": "^0.58.5",
"react-native-device-info": "^0.26.2",
"react-native-gesture-handler": "^1.0.15",
"react-native-image-picker": "^0.28.0",
"react-native-img-cache": "^1.6.0",
"react-native-push-notification": "^3.1.2",
"react-native-section-list-get-item-layout": "^2.2.3",
"react-native-vector-icons": "^6.2.0",
"react-native-webview": "^5.0.5",
"react-navigation": "^3.0.9",
"rn-fetch-blob": "^0.10.15"
},

@aeruhxi
Copy link

aeruhxi commented Mar 13, 2019

This problem still persists in v0.59

@dulmandakh
Copy link
Contributor

Hello there 👋 this issue doesn't have a repro (which means, a react-native init-ed project with the minimal changes that leads to creating the same issue you are reporting). Unfortunately, I have no way of helping you in a meaningful way – there is no easy way for me to recreate the situation and check that the issue reported is still there when changing the code.

Because of this, we are going to close this issue - but if a repro is shared, we are happy to reopen it 🤗

@aeruhxi
Copy link

aeruhxi commented Mar 20, 2019

Reproducible Demo:

On a freshly created project by react-native-cli in android:

  1. Shake phone -> Dev Settings -> Uncheck JS Dev Mode and Use JS Deltas. Then back.
  2. Shake phone -> Turn on Debug JS Remotely. Then back
  3. Reload

Errors I got, visible in chrome developer tool console:

Invariant Violation: requireNativeComponent: "RCTView" was not found in the UIManager.

This error is located at:
    in RCTView
    in App
    in RCTView
    in RCTView
    in AppContainer


handleException | @ | Animated.js:32
-- | -- | --
  | logCapturedError | @ | TouchableOpacity.js:163
  | logError | @ | TouchableOpacity.js:198
  | expirationTime.callback | @ | VirtualizedList.js:10
  | commitUpdateEffects | @ | TouchableNativeFeedback.android.js:278
  | commitUpdateQueue | @ | TouchableNativeFeedback.android.js:266
  | commitAllLifeCycles | @ | VirtualizedList.js:516
  | commitRoot | @ | VirtualizedList.js:561
  | (anonymous) | @ | VirtualizedList.js:905
  | exports.unstable_runWithPriority | @ | ReactNativeRenderer-prod.js:281
  | completeRoot | @ | VirtualizedList.js:901
  | performWorkOnRoot | @ | VirtualizedList.js:879
  | performWork | @ | VirtualizedList.js:860
  | requestWork | @ | VirtualizedList.js:803
  | scheduleWork | @ | VirtualizedList.js:724
  | updateContainer | @ | VirtualizedList.js:983
  | render | @ | VirtualizedList.js:1243
  | renderApplication | @ | blob:http://localhos…-ff13938d9900:37149
  | run | @ | ListViewDataSource.js:188
  | runApplication | @ | ListViewDataSource.js:255
  | __callFunction | @ | ReactNativeART.js:322
  | (anonymous) | @ | ReactNativeART.js:157
  | __guard | @ | ReactNativeART.js:280
  | callFunctionReturnFlushedQueue | @ | ReactNativeART.js:157
  | (anonymous) | @ | debuggerWorker.js:80


@dulmandakh Hi, can you check this and consider reopening the issue? Thanks.

@th317erd
Copy link

th317erd commented Jun 5, 2019

@dulmandakh Can you reopen this issue? I am also having the same problem, and now there is a reproducible example (posted above).

facebook-github-bot pushed a commit that referenced this issue Jun 6, 2019
)

Summary:
Remote debugging stopped working (since 0.58, according to #23254). See #23254 (comment) for repro steps.

The root cause is incorrect checks for Chrome debugging environment in `UIManager.js`.
- In one place where sync function `lazilyLoadView` should be avoided, we effectively use `if (__DEV__ && !global.nativeCallSyncHook)` to check remote debugging, which misses ship flavor (i.e. `__DEV__` is false).
- In another place where we want to pre-populate view managers' constants to avoid calling sync function `getConstantsForViewManager`, `if (__DEV__)` is used, also missing ship flavor.

This PR fixes both checks, only using the absense of `global.nativeCallSyncHook` to determine remote debugging environments.

## Changelog

[JavaScript] [Fixed] - Correctly bypass sync calls in UIManager during remote debugging
Pull Request resolved: #25162

Differential Revision: D15692492

Pulled By: cpojer

fbshipit-source-id: 173b688f140916b767fcdbbaaf68a5c303adbcd1
M-i-k-e-l pushed a commit to M-i-k-e-l/react-native that referenced this issue Mar 10, 2020
…ebook#25162)

Summary:
Remote debugging stopped working (since 0.58, according to facebook#23254). See facebook#23254 (comment) for repro steps.

The root cause is incorrect checks for Chrome debugging environment in `UIManager.js`.
- In one place where sync function `lazilyLoadView` should be avoided, we effectively use `if (__DEV__ && !global.nativeCallSyncHook)` to check remote debugging, which misses ship flavor (i.e. `__DEV__` is false).
- In another place where we want to pre-populate view managers' constants to avoid calling sync function `getConstantsForViewManager`, `if (__DEV__)` is used, also missing ship flavor.

This PR fixes both checks, only using the absense of `global.nativeCallSyncHook` to determine remote debugging environments.

## Changelog

[JavaScript] [Fixed] - Correctly bypass sync calls in UIManager during remote debugging
Pull Request resolved: facebook#25162

Differential Revision: D15692492

Pulled By: cpojer

fbshipit-source-id: 173b688f140916b767fcdbbaaf68a5c303adbcd1
@facebook facebook locked as resolved and limited conversation to collaborators Mar 19, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Mar 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

8 participants