Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue on Linux with '/dev/stdin' "can't open". #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrew-dixon
Copy link

There is an issue on Linux where the /dev/stdin is not readable and PhantomJS then returns the response:

Can't open '/dev/stdin'

To fix this you need to pass PhantomJS to the filename instead of the stdin and this change does just that. I've tested this on Mac OS X and Linux and it worked fine.

@cognitom
Copy link
Owner

cognitom commented Jan 3, 2015

We need to stick to stdin because there's possibility that other plugins change the input files. I think.

Anyway, it seems a bug. Thanks for reporting!

Can't open '/dev/stdin'

@cognitom
Copy link
Owner

cognitom commented Jan 3, 2015

It seems related to #1
I've been wondering why the tests fail on Travis.

@andrew-dixon
Copy link
Author

Ok, I see what you mean, I will take a look and see if there is a better way to do this then that works with Linux as I've not come across this issues with any other plugins.

@andrew-dixon
Copy link
Author

@cognitom - The only way I can see to get this to work not using the stdin is to write the contents of the file (file.contents) to a temporary on disk file and then pass that temporary file to phantomjs as phantomjs appears to insist on it being in a file. Maybe I'm wrong as I basically no experience of writing Gulp plugins and not very much with nodejs dev. How does that sound to you?

@joetoth
Copy link

joetoth commented Feb 22, 2015

fyi, ran into this problem and the commit fixed it. Would be super if you could push a new npm =)

@cognitom
Copy link
Owner

@joetoth thanks for remind me.
BTW, to merge this PR, we need to find the way to read from stdin on Linux. At least, we should export the content of vinyl into the temp file. (but this approach will violate the guideline of gulp.js)

@joetoth
Copy link

joetoth commented Feb 24, 2015

I only briefly looked at node.js (spent the weekend playing around). Here is another example that creates a child processs and passes the the file.path.
https://github.com/spreaker/gulp-aws/blob/master/index.js#L62
I guess this can be done the same way?

@cognitom
Copy link
Owner

@joetoth it may not work in this case. The command phantomjs doesn't support stdin natively. That was the reason I had to use /dev/stdin...

@felixzapata
Copy link

hi, the same problem when you try to execute in Windows.

rogervanwile added a commit to rogervanwile/gulp-phantom that referenced this pull request Jun 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants