【发布时间】:2015-11-05 02:21:40
【问题描述】:
我正在使用 meteor-up 来设置 phantomJS 和其他一切。似乎一切正常,并且 phantomJS 似乎安装在服务器上,因为我可以运行运行 phantomjs 控制台的phantomjs。
但是,我在 phantomjs 实际上获取我的页面的标题/描述时遇到了问题。
这是我在运行类似以下内容时遇到的错误:
example.com/?_escaped_fragment_=
TypeError: 'undefined' is not a function (evaluating 'n[i].bind(this)')
http://example.com/1fbd069174c2da0b715cdaf4e4551e5d00800cbc.js:135
http://example.com/1fbd069174c2da0b715cdaf4e4551e5d00800cbc.js:135
http://example.com/1fbd069174c2da0b715cdaf4e4551e5d00800cbc.js:135
http://example.com/1fbd069174c2da0b715cdaf4e4551e5d00800cbc.js:135
http://example.com/1fbd069174c2da0b715cdaf4e4551e5d00800cbc.js:135 in h
http://example.com/1fbd069174c2da0b715cdaf4e4551e5d00800cbc.js:517
http://example.com/1fbd069174c2da0b715cdaf4e4551e5d00800cbc.js:517
TypeError: 'undefined' is not an object (evaluating 'Package["service-configuration"].ServiceConfiguration')
http://example.com/1fbd069174c2da0b715cdaf4e4551e5d00800cbc.js:101
http://example.com/1fbd069174c2da0b715cdaf4e4551e5d00800cbc.js:3
http://example.com/1fbd069174c2da0b715cdaf4e4551e5d00800cbc.js:3
我不确定为什么我得到未定义的服务配置包。我从来没有引用过那个包。如果有人能帮我解决这个问题,那就太好了。
【问题讨论】:
-
PhantomJS 1.x 不支持
Function.prototype.bind,你必须使用shim。不过,我不知道在您的情况下如何做到这一点。在 CasperJS 中可以这样完成:stackoverflow.com/a/25359714
标签: meteor phantomjs meteor-up