#targetengine not working in VSC
Hi All, I’m having a problem with event scripts that need a target engine in Visual Studio Code with the latest ExtendScript Debugger 2.02. I get an error running out of Code but not when I run from the Scripts panel.
This:
#targetengine "session";
main();
function main(){
app.eventListeners.add("beforeExport", onExport );
}
/**
* Function to run before an Export
* @ param the event
*/
function onExport(e){
alert("Hello")
}
Throws this error running from VSC:

I have a feeling the problem might be with my JSON launch code, which is this—do I need something different for engineName?:
{
"version": "0.2.0",
"configurations": [
{
"name": "ExtendScript debug",
"type": "extendscript-debug",
"request": "launch", //"launch" or "attach"
"hostAppSpecifier": "indesign",
"engineName": "main",
}
]
}

