Hi JD,
I made the change and it got rid of the error re: outside the async. But it created another. On line 4, the error highlights ‘const’ and says it is a “Parsing error: unexpected token”
1 import { pdf } from ‘backend/pdf.jsw’ ;
2
3 export async function generatePoster_click(event)
4 const petDescription = $w( ‘#petDescription’ );
5 const whereWhen = $w( ‘#whereWhen’ );
6 const contactInfo = $w( ‘#contactInfo’ );
7 const phone = $w( ‘#phone’ );
8
9 const pdfUrl = await getPdfUrl({petDescription, whereWhen, contactInfo, phone});
10 $w( “#button2” ).link = pdfUrl;
11 $w( “#button2” ).target = “_blank” ;
12 $w( “#button2” ).label = “Open PDF” ;
13 $w( “#button2” ).show();
14 }