Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

run curl http://localhost:3000/?url=www.google.com > google.png get error #81

Open
scdxcc opened this issue May 22, 2017 · 3 comments
Open

Comments

@scdxcc
Copy link

scdxcc commented May 22, 2017

Error
at Request._callback (/home/app/screenshot-as-a-service/routes/index.js:82:25)
at Request.self.callback (/home/app/screenshot-as-a-service/node_modules/request/main.js:119:22)
at Request. (/home/app/screenshot-as-a-service/node_modules/request/main.js:212:58)
at emitOne (events.js:77:13)
at Request.emit (events.js:169:7)
at ClientRequest.self.clientErrorHandler (/home/screenshot-as-a-service/node_modules/request/main.js:209:10)
at emitOne (events.js:77:13)
at ClientRequest.emit (events.js:169:7)
at Socket.socketErrorListener (_http_client.js:267:9)
at emitOne (events.js:77:13)

@varunsharma27
Copy link

Same Here :-

Express server listening on 127.0.0.1:3000
phantomjs output: TypeError: undefined is not an object (evaluating 'phantom.args[0]')


phantomjs output:   phantomjs://code/rasterizer.js:9 in global code

Request for http://www.google.com - Rasterizing it
Error while requesting the rasterizer: connect ECONNREFUSED 127.0.0.1:3001
Stopping Phantomjs internal server
Phantomjs internal server listening on port 3001
Error
    at Request._callback (/home/vsharma/Desktop/Learning/PhantomJs/screenshot-as-a-service/routes/index.js:82:25)
    at Request.self.callback (/home/vsharma/Desktop/Learning/PhantomJs/screenshot-as-a-service/node_modules/request/main.js:119:22)
    at Request.<anonymous> (/home/vsharma/Desktop/Learning/PhantomJs/screenshot-as-a-service/node_modules/request/main.js:212:58)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:188:7)
    at ClientRequest.self.clientErrorHandler (/home/vsharma/Desktop/Learning/PhantomJs/screenshot-as-a-service/node_modules/request/main.js:209:10)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at Socket.socketErrorListener (_http_client.js:309:9)
    at emitOne (events.js:96:13)
phantomjs output: TypeError: undefined is not an object (evaluating 'phantom.args[0]')


phantomjs output:   phantomjs://code/rasterizer.js:9 in global code

Phantomjs process is sleeping. Restarting.
Stopping Phantomjs internal server
Phantomjs internal server listening on port 3001
phantomjs output: TypeError: undefined is not an object (evaluating 'phantom.args[0]')

@varunsharma27
Copy link

varunsharma27 commented Jul 27, 2017

This is happening because we are using PhantomJs 2+. To fix this issue, go to ./screenshot-as-a-service/scripts/rasterizer.js

And add these LOC at the top :-

var system = require('system');
if (typeof(phantom.args) === 'undefined') {
 phantom.args = system.args.slice(1);
}

@makehavoc
Copy link

makehavoc commented Nov 13, 2017

@varundbest Thank you. Your code added to the top of ./screenshot-as-a-service/scripts/rasterizer.js made it work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants