Skip to main content

Unable to add ‘await’. Get the editor error Missing “;” before statement. on line 16.
Without the await the code executes but the binary file arrives corrupted due to truncating. Why cant I add the await syntax to line 16?

const encodedToken = Buffer.from(bundle.authData.api_key, 'ascii').toString('base64');

const fileRequest = z.request({
url: 'https://app.useanvil.com/api/v1/generate-pdf',
raw: true,
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Basic ${encodedToken}`
},
body: {
'data':bundle.inputData.template
}
});

const file = await z.stashFile(fileRequest);

return {file};

 

Hi @amarunda 

If you are building a Zap app integration, then you should post your topic in the Developer Zone: https://community.zapier.com/p/developer-zone


ok noted


This might work.

const file = await(z.stashFile(fileRequest));

 


Reply