"ReferenceError: Can't find variable" error when open web page

857 views
Skip to first unread message

qihang zhang

unread,
Feb 27, 2015, 4:52:06 AM2/27/15
to phan...@googlegroups.com
Hi all,
I have one internal web page which can be opened by chrome without any error, but it will raise "ReferenceError: Can't find variable: myVariable " error if I open it by phantomjs.
It's an internal website, so I can't share the link with you.....

I guess some differences between chrome and phantomjs caused this issue,  I googled about it, but got nothing useful.  Is there a guide or something which can tell me how to locate the root cause or debug this issue?

Any comments would be helpful! Many thanks :)

Alex Puppken

unread,
Feb 27, 2015, 8:56:19 AM2/27/15
to phan...@googlegroups.com
I'am not specialist in Phantomjs, but is this variable so important for your code? Also, make a screenshor of the page using phantom.render() and save a page source to a file and look it up.

пятница, 27 февраля 2015 г., 11:52:06 UTC+2 пользователь qihang zhang написал:

qihang zhang

unread,
Mar 2, 2015, 3:13:35 AM3/2/15
to phan...@googlegroups.com
Thanks Alex , really appreciate your help!

And I found the root cause, there is a piece of code using the new JavaScript data structure 'Set' , which is supported by Chrome but not supported by phantomjs yet. While the weird thing is phantomjs's error traceback can not locate this piece of code, I think phantomjs should raise kinds of "Unimplemented Error" for these cases.

Many thanks!

My env:
ubuntu
phantomjs --version: 2.0.1-development

Shaiju Janardhanan

unread,
Aug 22, 2015, 8:10:55 AM8/22/15
to phantomjs
Hi Zhang,

I am facing similar issue while using google visualisation API..Were you able to resolve the issue? 
But the strange thing is once i start google chrome and then run phantomjs from command prompt it works fine
Reply all
Reply to author
Forward
0 new messages