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
importuWSfrom'uWebSockets.js';classApplication{
#app;constructor(options){this.#app =uWS.App(options);}listen(port,callback){this.#app.listen(port,callback);}}constapp=newApplication();app.listen(3000,()=>{console.log('Server is running on port 3000');});
importuWSfrom'uWebSockets.js';constapp=uWS.App();app.listen(3000,()=>{console.log('Server is running on port 3000');});
It works fine. So for some reason uWS doesn't work when it's inside class? Also tested a bit more and it doesn't work when it's inside a function too. I'm using Node.js 20.17.0 and uWS v20.48.0 on Windows 11.
The text was updated successfully, but these errors were encountered:
Oh! It's apparently sending undefined as options causing this. I guess it should still handle it properly to avoid confusion, so I'll leave the issue open.
Running this code:
Gives this error:
But if I run this code instead:
It works fine. So for some reason uWS doesn't work when it's inside class? Also tested a bit more and it doesn't work when it's inside a function too. I'm using Node.js 20.17.0 and uWS v20.48.0 on Windows 11.
The text was updated successfully, but these errors were encountered: