-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object. #9
Comments
It may be sufficient to just set https://developer.mozilla.org/en-US/docs/Web/API/WebSocket#Attributes |
@isobit yes, this does the job |
@isobit also I have updated it to the latest lib from |
@isobit @valichek I have tried the update to Uncaught TypeError: url.format is not a function
at Object.exports.createConnection (websocket-nats.dev.js:3967)
at Client.createConnection (websocket-nats.dev.js:645)
at new Client (websocket-nats.dev.js:211)
at Object.exports.connect (websocket-nats.dev.js:224)
at (index):6 using this code to test: <html>
<head>
<script src="../dist/websocket-nats.dev.js"></script>
<script>
var nats = NATS.connect('ws://localhost:8080/');
setInterval(function () {
nats.publish('topic.123', JSON.stringify({ date: new Date().toDateString() }));
}, 1000);
nats.subscribe('topic.*', function (data) {
console.log(JSON.parse(data));
});
</script>
</head>
<body></body>
</html> NATS is deployed using Docker and Websockets TCP relay:
|
@antonioaguilar hi, note that if you use https://github.com/valichek/websocket-nats/tree/update-to-0.7.24 you will get this error, because I didn't update |
@valichek I built using |
@antonioaguilar do you mean that creating |
My apologies, I haven't updated this repo in a while; I will merge in the latest from upstream (node-nats) ASAP. I believe I actually have a branch lying around with some changes to use a newer webpack version as well... @valichek I didn't want to merge your fork directly because your indentation whitespace changes created a massive diff for |
Checked in FF and Chrome. Getting
TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.
Here is a line that throws error. https://github.com/isobit/websocket-nats/blob/master/lib/net.js#L14
The cause is that
e.data
is ofBlob
type.The text was updated successfully, but these errors were encountered: