Invariant Violation: Calling synchronous methods on native modules is not supported in Chrome.
See original GitHub issueI updated to version 1.92.0 from 1.89.1 (working on iOS) and I am getting following warning when I debug react-native app
index.bundle?platform=ios&dev=true&minify=false:48831 0 Invariant Violation: Calling synchronous methods on native modules is not supported in Chrome.
Consider providing alternative methods to expose this method in debug mode, e.g. by exposing constants ahead-of-time.
at invariant (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:1899:17)
at MessageQueue.callNativeSyncHook (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:3030:11)
at Object.nonPromiseMethodWrapper [as peerConnectionInit] (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:2724:32)
at new RTCPeerConnection (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:109188:20)
at getNativeRtpCapabilities$ (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:167274:22)
at tryCatch (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:26662:19)
at Generator.invoke [as _invoke] (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:26835:24)
at Generator.next (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:26705:23)
at tryCatch (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:26662:19)
at invoke (http://localhost:8081/index.bundle?platform=ios&dev=true&minify=false:26735:22)
Expected behavior
I shouldn’t not be getting this warning.
Ps: It works fine if you aren’t debugging
What have I tried to fix it
- Removed node_modules and installed again
- Remove pods folder and podlock file
- npm reset cache
Platform information
- React Native version: 0.62.2
- Plugin version: 1.92.0
- OS: Tested on iOS
- OS version:
Issue Analytics
- State:
- Created 2 years ago
- Comments:22 (9 by maintainers)
Top Results From Across the Web
Invariant Violation: Calling synchronous methods on native ...
Invariant Violation : Calling synchronous methods on native modules is not supported in Chrome. Consider providing alternative methods to expose ...
Read more >Calling synchronous methods on native modules is ... - GitHub
Invariant Violation : Calling synchronous methods on native modules is not supported in Chrome. Consider providing alternative methods to ...
Read more >Calling synchronous methods on native modules is ... - Reddit
Calling synchronous methods on native modules is not supported in Chrome and 'main' has not been registered ... This error is due to...
Read more >Cannot debug in chrome - Issues developing apps - OpenVidu
Invariant Violation : Calling synchronous methods on native modules is not supported in Chrome. Consider providing alternative methods to expose ...
Read more >Invariant Violation: Calling synchronous methods on native ...
Coding example for the question Invariant Violation: Calling synchronous methods on native modules is not supported in Chrome-React Native.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @irohitb,
Improving data channel communication cause this issue.
As there are not so important updates and not so significant improvements I would recommend you to downgrade to react-native-webrtc@1.89.1 for debugging. For production/staging it will work also, but if you want, you can have the latest version for production/staging and 1.89.1 for debugging,
Please provide a normal workable chrome debugging solution, then there will be no such advise. For debugging we have to use 1.89.1, but for prod I recommend to use latest. I still do not understand why this library require initial sync operations that is blocking debugging? Please fix it if you can do it or follow practical advise on random comments.