问题描述
将 react-native-peerjs 模块导入 React Native 项目中的任何文件时,我面临一个复杂的错误.我只是尝试了一切,但没有任何效果.你能帮助我吗?这就是错误.
I'm facing a complex error when import react-native-peerjs module to any file in React native project. I just tried everything, but nothing works. Can you help me?That is the error.
错误:未知命名模块react-native-webrtc"
Error: Unknown named module "react-native-webrtc"
如果有人想测试,这是分步说明.
This is the step-by-step if someone wanna test.
npx react-native init teste.纱线添加 react-native-webrtc.cd ios &&吊舱安装.光盘...纱线添加 react-native-peerjs.npx react-native run-ios.从 App.js 中的react-native-peerjs"导入 Peer
npx react-native init teste.yarn add react-native-webrtc.cd ios && pod install.cd ...yarn add react-native-peerjs.npx react-native run-ios.import Peer from 'react-native-peerjs' in App.js
推荐答案
在位于应用根文件夹的 metro.config.js
上,将 inlineRequires
更改为false
应该可以完成这项工作.
On metro.config.js
located at the root folder of the app, changing the inlineRequires
to false
should do the job.
这篇关于错误:未知命名模块“react-native-webrtc"当导入 peerjs 模块时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!