Open pgaurav9 opened 2 years ago
Hey @pgaurav9 ,
Could you please let us know the following so that we can debug this:
Thanks
Hi @softvar ,
I am using the following:
Let me know if further information is required. Thanks!
Hi @pgaurav9 ,
After debugging, it seems to be an issue with Node 14.x and 16.x versions. This is something related to how async-await works internally. Our SDK does not use sockets, instead only https module for sending any async network call.
Please try without async-await
syntax and let us know if it's resolved for you.
In the meantime, we are still figuring out what is causing this issue in different latest node.js versions.
hey @softvar, we've been seeing this in our application and I attempted to get a minimal repro setup for y'all to debug here: https://github.com/nickdandakis/vwo-node-nextjs-ssr
of course, as these things go, this minimal repro doesn't actually produce the ECONNRESET
issue reliably. we've also found that the local server doesn't actually crash (maybe nextjs is handling this gracefully), and the deployed environment (on Render or AWS) doesn't actually produce this ECONNRESET
I tried using node v14, v16 (what we use), and v18 (app doesn't even run on v18 yet), and no luck in getting a consistent repro.
I'll keep the repo up in case it's helpful for anyone else trying to get the VWO node SDK to work against SSR Nextjs, which I imagine is becoming more and more popular.
we have the same issue
Node version: 18.12.0
Yarn version: 1.22.17
VWO-node-SDK version: 1.41.0
Yes we are using Express(version 4.17.1)
Errors roll once we run vwo.launch
this PR fixes (kinda) the issue - https://github.com/wingify/vwo-node-sdk/pull/44. At least it doesn't crash the server anymore.
While integrating the
vwo-node-sdk
library on the server-side of an existing SSR react application is crashing the whole application. Following is the exception that I am receiving: `events.js:377 throw er; // Unhandled 'error' event ^Error: read ECONNRESET at TLSWrap.onStreamRead (internal/stream_base_commons.js:209:20) Emitted 'error' event on ClientRequest instance at: at TLSSocket.socketErrorListener (_http_client.js:475:9) at TLSSocket.emit (events.js:400:28) at emitErrorNT (internal/streams/destroy.js:106:8) at emitErrorCloseNT (internal/streams/destroy.js:74:3) at processTicksAndRejections (internal/process/task_queues.js:82:21) { errno: -54, code: 'ECONNRESET', syscall: 'read' } error Command failed with exit code 1.`
However, the documentation provided here, mentioned about following best practices, which itself is a generic statement. Kindly help here. Thanks!
Please follow the best practices to ensure that your app is prevented from crashing.