-
It comes from https://github.com/uNetworking/uWebSockets.js/blob/3860b922c7192a2e9b36edebf599a27746f56368/src/Utilities.h line 69 right now, but the rest of the code in that file is too far removed that I'm not certain which of my files is causing this issue. There is also no output when using the trace flags from node, so I'm at a loss to determine how I can provide more of a stack trace. Any help is appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
This is most likely because of your code, not an issue with the library. However, make sure that you're sending either proper string data when calling send() or publish() (maybe a stringified JSON), or a proper binary data like ArrayBuffer (and all the views over it) or Buffer. For the latter, you need to give a 2nd parameter of |
Beta Was this translation helpful? Give feedback.
-
So the issue that makes it hard to debug is that everything works fine when using express - I switched to nanoexpress which uses uWebSockets.js as a dependency - and this warning pops as soon as I try But what I read in your comment
Makes me realize that this won't support actual JSON, like |
Beta Was this translation helpful? Give feedback.
-
Update - I went line-by-line and found the offending line to be here:
This works fine in Express, but obviously it's offending uWebSockets.js for whatever reason - and I don't care very much, I've simply unwound the logging statement from the listen statement. Feel free to ignore - but leaving this here as documentation for someone converting from Express in the future. |
Beta Was this translation helpful? Give feedback.
-
I don't know what tools you are running but it really can't be made more obvious:
Generally I would say, you can't just assume that whatever Express does, uWS.js will do the same. They are two entirely different projects and you'll have to follow the docs more closely. |
Beta Was this translation helpful? Give feedback.
I don't know what tools you are running but it really can't be made more obvious:
Generally I would say, you can't just assume that whatever Express does, uWS.js will do the same. They are two entirely different projects and you'll have to follow the docs more closely.