getting more information from phantomjs “SyntaxError: Parse error” message

前端 未结 7 2204
感动是毒
感动是毒 2020-12-03 04:38

I have a long script that was not written by me. When i run it I get:

phantomjs file.js
SyntaxError: Parse error

i checked out the manual a

相关标签:
7条回答
  • 2020-12-03 05:02

    I did have the same issue, but none of the solutions worked for me.

    I figured that the issue was probably an unsupported syntax by PhantomJS's webkit, since my page was working correctly in current browsers' versions.

    What I did was finding out which webkit version PhantomJS was using, for 1.9.* it's here, 34.534.

    Now we have to find the Chromium version using the same webkit, or close to it, in here (for Mac).

    Ended up going with the Mac OSX 267668 and installed it.

    Loaded the same URL as PhantomJS, and here it was, a real Uncaught SyntaxError: Unexpected token with a full stack trace.

    Hope that helps.

    0 讨论(0)
提交回复
热议问题