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

Report error reason starting electron #22

Closed
stephennancekivell opened this issue Mar 29, 2017 · 5 comments
Closed

Report error reason starting electron #22

stephennancekivell opened this issue Mar 29, 2017 · 5 comments

Comments

@stephennancekivell
Copy link

Hi, thanks for karma-electron.

I dont think karma-electron is reporting startup errors from electron, which would be nice to do.

One example is if libgtk2.0-0 isnt installed. When running karma from npm run all it shows is the message Cannot start Electron, but if you run electron on its own it will give more descriptive stack trace. libgtk2.0-0 not found.

I would think you can redirect stderr to get this..

Karma message

ERROR [launcher]: Cannot start Electron
ERROR [launcher]: Electron failed 2 times (cannot start). Giving up.

expected

ERROR [launcher]: Cannot start Electron
ERROR [launcher]: Error from electron. libgtk2.0-0.so not found
ERROR [launcher]: Electron failed 2 times (cannot start). Giving up.
@twolfson
Copy link
Owner

This is a problem in Karma itself, not our library specifically =/ Here's a gist demonstrating the same issue but in Firefox in a Docker container:

https://gist.github.com/twolfson/f099e18cf5eb9cc55384e7a0582fbe10

Karma message:

root@85de9cecee79:/docker# npm test

> gist-karma-launcher-fail@1.0.0 test /docker
> FIREFOX_BIN=$PWD/vendor/firefox/firefox karma start

30 03 2017 04:00:46.897:INFO [karma]: Karma v1.5.0 server started at http://0.0.0.0:9876/
30 03 2017 04:00:46.899:INFO [launcher]: Launching browser Firefox with unlimited concurrency
30 03 2017 04:00:46.906:INFO [launcher]: Starting browser Firefox
30 03 2017 04:00:46.922:ERROR [launcher]: Cannot start Firefox
	
30 03 2017 04:00:46.929:INFO [launcher]: Trying to start Firefox again (1/2).
30 03 2017 04:00:46.936:ERROR [launcher]: Cannot start Firefox
	
30 03 2017 04:00:46.940:INFO [launcher]: Trying to start Firefox again (2/2).
30 03 2017 04:00:46.949:ERROR [launcher]: Cannot start Firefox
	
30 03 2017 04:00:46.952:ERROR [launcher]: Firefox failed 2 times (cannot start). Giving up.

Running Firefox directly:

root@85de9cecee79:/docker# ./vendor/firefox/firefox
XPCOMGlueLoad error for file /docker/vendor/firefox/libmozgtk.so:
libgtk-3.so.0: cannot open shared object file: No such file or directory
Couldn't load XPCOM.

We've received this issue before in #17 and I'm almost certain I've encountered it before (e.g. when setting up this repo in Travis CI). I'm going to see if there are any existing Karma issues to resolve this

@twolfson
Copy link
Owner

There seems to be karma-runner/karma#2465 but no PRs to resolve it. It's not exactly what we want as it requries opt-in but I feel like it would be close enough for PRs.

I've found a reasonable patch for our behavior which I'll submit briefly

@twolfson
Copy link
Owner

twolfson commented Mar 30, 2017

Alright, we've opened up karma-runner/karma#2639. I'm going to close this issue since it's outside of karma-electron's scope

@stephennancekivell
Copy link
Author

Legend! thanks @twolfson

@twolfson
Copy link
Owner

twolfson commented Apr 5, 2017

Good news! Our patch has been landed/released in karma@1.6.0 🎉

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

No branches or pull requests

2 participants