I am getting the infamous:
“[”(node:1) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.“]”
error sometimes (not always!) when certain functions in my back-end code are called via my web API. I have scoured this forum and read various posts about why this error occurs, but I still don’t really understand it.
An example from in the code within my http-functions.js file where I see this (sometimes) occur is:
export async function get_utils(request){
let response = {
"headers": {
"Content-Type": "application/json"
}
};
// ex: "login"
switch (request.path[0]) {
case 'validlogin':
console.log("validlogin function called.");
response.body = {[RESULT_KEY]:false}; // Default false
memberEmail = request.query[EMAIL_ARG];
deviceId = request.query[DEVICEID_ARG];
await isLoginForDeviceValid(deviceId, memberEmail, response);
return ok(response);
and isLoginForDeviceValid looks like:
async function isLoginForDeviceValid (deviceId, memberEmail, response) {
console.log("isLoginForDeviceValid function called - myDeviceId:" + deviceId + " email: " + memberEmail);
if (typeof deviceId === 'undefined') {
response.body.result = false;
return "";
}
let userid = "";
// First see if we even know about this member
await wixData.query(SITMEMBERS_TABLE)
.eq(EMAIL_ARG, memberEmail)
.include(MEMBERDEVICES_FIELD)
.find(options)
.then( (results) => {
A BUNCH OF VALIDATION STUFF HERE, EVENTUALLY KEY INFO CONTAINED IN
response.body
})
.catch( (error) => {
console.log("Got error attempting to validate user with email: " + memberEmail +
" error was: " + error + " device NOT VALID.");
response.body = {[RESULT_KEY]: false,[ERRORMSG_KEY] : error.message};
return userid;
});
return userid;
I am not using a “MakeCallback” function in my code, at least not explicitly.
I don’t have any special node modules installed - I am just using the stock stuff from Corvid. My imports at the top of my http-functions.js file are:
import {ok, badRequest} from 'wix-http-functions';
import wixUsers from 'wix-users-backend';
import wixData from 'wix-data';
import wixCrm from 'wix-crm-backend';
import { mediaManager } from 'wix-media-backend';
What does this error actually mean, and what do I do to go about getting rid of it? More seriously, I have noticed some spurious WDE internal Wix data errors that occur in these same functions, so I’m wondering if that is related somehow?