• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

help - Finding a syntax error in a jsx file - just getting a dialog

Participant ,
Mar 27, 2017 Mar 27, 2017

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

TOPICS
SDK

Views

997

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Mar 27, 2017 Mar 27, 2017

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.

Votes

Translate

Translate
Explorer ,
Mar 27, 2017 Mar 27, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 27, 2017 Mar 27, 2017

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

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 27, 2017 Mar 27, 2017

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 27, 2017 Mar 27, 2017

Copy link to clipboard

Copied

LATEST

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines