I have made a shopify app using the delivery customization framework. It has a function in the run.js
//...Above code
export async function run(input) {
const configuration = JSON.parse(
input?.deliveryCustomization?.metafield?.value ?? "{}"
);
const axios = require('axios');
var x = 10;
try {
const response = await axios.post(functionUrl, data, {
headers: {
'Content-Type': 'application/json'
//,'x-functions-key': functionKey
}
});
x = 5;
} catch (error) {
x = 2;
}
//More code...
It seems like shopify does not allow async calls how can I call the azure function without using async/await.
I have tried to use a diffrent library (fetch) than axios but that did not work.
I have tried using a “then, catch” block to use a promised based system but that also did not work.