Alwinator / Alwinator/react-native-http-bridge-refurbished

IOS not working - BridgeServer undefined

Đang mở
#43 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
75
Fork
30
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hello team,

I am trying to run the library and its working for android without issues but in ios it crashes with error

```
ERROR Invariant Violation: `new NativeEventEmitter()` requires a non-null argument., js engine: hermes [Component Stack]
LOG error: [TypeError: Cannot read property 'BridgeServer' of undefined]
```

Also the native modules is empty which means its not loaded.

I am working on a Mac M2, using react native native (without expo) with packages

```
"react-native-http-bridge-refurbished": "^1.2.9",
"react": "18.3.1",
"react-native": "0.75.4",
```

and the code is

```
import { BridgeServer } from 'react-native-http-bridge-refurbished';

useEffect(() => {

try {

NetworkInfo.getIPV4Address().then(ipv4Address => {
console.log('Phone IP:', ipv4Address);
});
console.log('running server');
const server = new BridgeServer('http_service', true);
server.get('/', async (req, res) => {
console.log("in here")
return { message: 'OK' };
});
server.listen(3000);

return () => {
server.stop();
};
} catch (e) {
console.log("error:", e);
}
}, []);
```

Any ideas about the issue ? Is it the RN version ??

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.