0

I don't understand how to properly import components from webrtc into a project file without errors. When importing the lines:

import { RTCPeerConnection, RTCIceCandidate, RTCSessionDescription, RTCView, mediaDevices } from 'react-native-webrtc';

both from all components and a single component gives an error:

ERROR TypeError: Superexpression must be either null or a function, engine js: hermes ERROR Invariant Violation: "main" was not registered. This can happen if:

  • Metro (local dev server) is running from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
  • Module failed to load due to an error and AppRegistry.registerComponent was not called., js engine: hermes

Solutions taken:

  • reinstalling the library
  • project rebuild
  • restart Metro

Ideally, nothing else can influence this error, because exactly the same error occurs if you build a clean project with only this library and try to import it.

I will be very grateful for your help. I am trying to solve the problem for the second day. Thank you!

1 Answer 1

0

That's because you're using the latest version of webrtc, and it's not fully compatible for some reason, you need to downgrade the version. Use npm i [email protected]

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.