-
Notifications
You must be signed in to change notification settings - Fork 21
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
Error Message - nsrestlet.js:531 #4
Comments
Hey there @WimSuenensDIRACIndustries, It's kinda hard to diagnose the problem without seeing your code. Can you post the following:
I know some parts of the code may be private, so just post the parts you think might be relevant. Thanks. |
Hi Michael, |
Hey Wim, thanks, I'll take a look at those. Also, can you tell me the following: Are you just using default nodemon from the command line (no arguments added)? Which version of nsrestlet do you have? (Trying to see if it's an earlier version) Which version is your Netsuite? (Like 2019.1, 2019.2, etc) |
Also, as a temporary fix, try the following:
Let me know if that works for you. I'm going to be heading to work soon, so it may be a while before my next response. I'll try to get back to you as soon as I can. Hope your having a good morning |
I'm using default nodemon, indeed. |
Thanks. Did the fix I posted above work? |
I've updated as requested and will test it like this in the next days. |
Thanks! And yeah, please let me know. Also, just a note, that code would have only been thrown if Netsuite threw an error. So just make sure your Error catching is smooth and you should be good. I'll also try and push an updated version of the module with this fix sometime soon. |
Hello Michael, |
Hey Wim, Hope you have an awesome Friday! |
Hi, Same thing happening to me. It only happens once every hundreds of calls, so I'm pretty sure it's a real exception on connection or NetSuite response. Very hard to replicate.
As it's not returning an error for line # 529 an body is undefined on line 538.
Otherwise perhaps add this check after line # 539
Otherwise:
But looks overkill... I haven't checked much into the rest of the code, so I'm not sure which style would suite you best or if any of this fixes looks good to you. I can do a PR with any if you prefer. |
Hey @mritzco thanks for catching that error. I'll try and push a corrected version up in the next two weeks that (hopefully) catches that. Sorry about the late response, and hope your week is going well :) |
Hey @MichaelEPope, Can you please upgrade your package after resolving all of the above issues. Thanks and regards. |
I am also sporadically hitting this error. Any updates on this? |
I hit the same issue sometimes. @MichaelEPope |
I've come up with a workaround that doesn't involve modifying function callNSEndpoint(method: string, payload: any): Promise<any> {
return new Promise((resolve, reject) => {
const d = domain.create();
d.on('error', reject);
d.run(async () => {
const link = nsrestlet.createLink(this.accountSettings, urlSettings);
const res = await link[method](JSON.parse(payload));
resolve(res);
});
});
} Note: this has been taken out of context so it will require a little adaptation. |
The module regulary crashes at line 531.
TypeError: Cannot read property 'message' of undefined.
The text was updated successfully, but these errors were encountered: