You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So far Peer.js works in react-native. I have only the problem as soon as I want to send a message that the connection is broken and gives me the following error:
DC #: dc_6igjvuv7fhg Error when sending: (TypeError) Data must be either string, ArrayBuffer, or ArrayBufferView.
Tested with RN 6.0.0 - 6.2.0.
In addition, although I can establish a connection, I do not get feedback from the connection.
localPeer.on('connection', conn => {
conn.on('open', () => {
console.log(conn.dataChannel);
conn.on('data', data => {
console.log(data);
conn.send("String");
});
console.log(conn.dataChannel);
});
});
var conn = localPeer.connect ('he8b');
console.log (conn);
conn.on ('open', () => {
console.log ("works"); // THIS NOT WORKS NOW!
});
Did you ever manage to solve this? I'm running into the same error, but if I set serialization to "json" brings up:
SyntaxError: JSON Parse error: Unexpected character: o
If I do serialization: none, then I'm able to receive a message from web and run it through Buffer.from(data).toString(), sending doesn't crash, but the client(the web app) receives 0.
So far Peer.js works in react-native. I have only the problem as soon as I want to send a message that the connection is broken and gives me the following error:
DC #: dc_6igjvuv7fhg Error when sending: (TypeError) Data must be either string, ArrayBuffer, or ArrayBufferView.
Tested with RN 6.0.0 - 6.2.0.
In addition, although I can establish a connection, I do not get feedback from the connection.
I don't have these problems in the browser.
My installed packages:
when i send a message from the browser it also arrives, but only when i start the connection from the browser
The text was updated successfully, but these errors were encountered: