browser-run icon indicating copy to clipboard operation
browser-run copied to clipboard

No output

Open adjenks opened this issue 5 years ago • 8 comments

When I run the example echo "console.log('Hey from ' + location); window.close()" | browser-run I get no output, but also no error message. How can I debug this?

adjenks avatar Feb 19 '20 21:02 adjenks

Running another test:

test.js:

var run = require('browser-run');
var browser = run();
browser.pipe(process.stdout);
browser.end('console.log(location); window.close()');
process.stdout.write('hi');// Check to see if console output is working

bash: $ node test/test.js

hi

It should also output the location but does not. No errors are reported.

adjenks avatar Feb 19 '20 21:02 adjenks

I tried to run electron on my console but it said I was missing a library. Perhaps browser-run fails to detect when electron fails to run.

error while loading shared libraries: libffmpeg.so

adjenks avatar Feb 19 '20 21:02 adjenks

Have you installed browser-run globally?

ashnur avatar Feb 20 '20 07:02 ashnur

@ashnur I just ran it using a global installation, same results. Before it was not --global.

adjenks avatar Feb 21 '20 18:02 adjenks

Weird. echo "console.log('Hey from ' + location); window.close()" | browser-run WFM on linux

maybe try with a different browser or try the development version (cloning this repo and try running the tests locally).

Also, if you share more information about the context, I am sure more people will likely to chime in with suggestions.

ashnur avatar Feb 21 '20 20:02 ashnur

The thing is, I understand that electron will not run. So that's probably the hangup. I would like to know however why it doesn't output any error message. How can I get more debug info from browser-run?

adjenks avatar Feb 21 '20 20:02 adjenks

This method does the actual spawning:

https://github.com/juliangruber/electron-stream/blob/0e25d5571b9dfaf4e828ab372c6cdad9b3b5f7f1/index.js#L79-L97

I guess we could read from stderr here to detect failures like this? Or we could make it so it throws an error if no "message" was received before the "exit", which is a more general solution.

juliangruber avatar Feb 24 '20 11:02 juliangruber

I'm having the same issue, using browser-run indirectly through tape-run. Electron fails to start (in my case due to libgconf-2.so.4: cannot open shared object file: No such file or directory) when I'm executing it directly, but browser-run provides no output.

sfriesel avatar May 10 '20 04:05 sfriesel