Copy link to clipboard
Copied
I
I'm starting to debug my first Premiere Pro Panel
When my panel opens up (and also after I refresh it) I get a dialog box saying Exception:SyntaxError: Expected: ;
- so - I've got a syntax error in one of my ExtendScript jsx (application) files - but how can I see where it is ?
I'm using both the chrome remote debug, andthe extendscripto toolkit but it's happening from within the call to CSInterface.prototype.evalScript, and neith of these tools picks up a problem of any sort
I tried to load the file into a normal chrome browser - but it did not complain about any problem at all
Thanks
Yonatan
Pull the .jsx file into ESTK, and hit 'play'; often, ESTK will identify where the missing ; is.
Next step (if that's fruitless) = debug your ExtendScript, function by function, in ESTK.
Copy link to clipboard
Copied
If someone knows the correct way of debugging Extendscript errors from a panel chime in. This is what I do:
1. Find the function you're calling in JSX from Panel Javascript.
2. Comment out the entire function body (everything inside the braces)
3. See if your call works from the panel javascript. If it does, start commenting out less code until you find the culprit.
4. If it doesn't work, then it's an error somewhere else in your JSX file that's messing with the interpreter
What are you coding in? If you're using an editor like Brackets it will point out some code errors like missing braces/brackets for you.
Copy link to clipboard
Copied
Also a reason I've got that error in the past is because I forgot to declare a function correctly:
var myFunction() { // Error: Expecting: ;
}
var myFunction = function() { // Correct
}
Copy link to clipboard
Copied
Pull the .jsx file into ESTK, and hit 'play'; often, ESTK will identify where the missing ; is.
Next step (if that's fruitless) = debug your ExtendScript, function by function, in ESTK.
Copy link to clipboard
Copied
I found the problem by doing a binary search - commenting out half the
code each time. A bit primitive and I was hoping that there was a
friendlier way, as there is in normal javascript debugging in chrome . In
the future I'll do as much debugging as I can in normal chrome.
As a suggestion, perhaps the file and line number where the problem
occurred are available and could be added to the Dialog.
Thanks for your replies.