1
0
-1

Error message -

file:///X:/avoka/transact/manager/work/phantomjs/delivery/82155-2381732/form.html:9605] SyntaxError:
Unexpected token '}'

How can i debug in this scenario?

when I open the PDF after the job is processed I could see this error in the first line of the PDF.

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Have you tried opening the form.html file in chrome. You may get more information on the error.

      1. Matthew White

        It is also worth looking at the console when loading the form in a browser as the error might be there also even though the form appears to work fine.

      2. prasantha

        To be honest I am a novice, so please excuse me if the below is a dumb question.

        could you please guide me how to get the form.html. The folder "...delivery" was empty when i have opened it.

      3. Matthew White

        Hi prasantha,

        Sometimes the form.html file would be left there after an error on older TM versions but now it usually gets cleaned up so you can ignore that advice.

        The error itself is a javascript error and most likely means that one of your script rules is not valid javascript. In the case of composer this can often happen if you haven't balanced your brackets or in some cases if you have removed a dependency but left a reference to it in the code. Occasionally Composer can get confused about where you are returning a value from and will insert its own return value and break the code.

        The best place to start looking is when you load the form in a browser to fill it out. Often errors can show there but not actually break anything. Sometimes if the code only runs on the receipt you may not see an error when you load the form. In that case it might be useful to look for any script rules that only run on receipt render.

        If you need more information on debugging javascript then a search for chrome developer tools and debugging should help.

        Different composer versions bundle your javascript differently, previously you could look for the error in the sfc_generated javascript file loaded by the browser, recently everything is bundled into a single file, I don't remember what it is called.

        Another thing to try is to render a receipt in TM using the Render Receipt Test harness. If you render your receipt there as html you may be able to see the error in the developer tools console.

        Matt



      4. prasantha

        Thanks a loooot Matt for your prompt reply. Will try the options which you suggested.


      CommentAdd your comment...