I'm trying to return an array of JSON objects using the results from a query, but I'm getting this error: Failed to execute 'postMessage' on 'Window': #<Promise> could not be cloned.
This is the Javascript query that I have.
var xsCount = extraSmallSizeAmount.value;
var xsSizeId = getSizeIdForName.trigger({
additionalScope: {
name: extraSmallSizeAmount.label,
},
});
var skus = [
{
"xsSizeId": xsSizeId,
"stock": xsCount
}
];
return skus;
I'm able to return just the xsSizeId
, so I can tell that the query I'm calling is returning the string correctly. Also able to see that xsCount is populating an int as I would expect. Individually, the pieces seem to all be fine, but when I create the object and try to return just that (even without the array), I get the error.
Any guidance would be appreciated!