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

Custom launcher require mechanism doesn't work #40

Closed
jushar opened this issue Jun 12, 2019 · 4 comments
Closed

Custom launcher require mechanism doesn't work #40

jushar opened this issue Jun 12, 2019 · 4 comments
Labels

Comments

@jushar
Copy link

jushar commented Jun 12, 2019

Description
After updating my application to Electron 5, I needed to use the workaround in #38 (comment) to enable the nodeIntegration.

Unfortunately, I can't get the require field within the customLaunchers property to work.
It always just outputs:

12 06 2019 11:20:45.649:INFO [karma-server]: Karma v4.0.1 server started at http://0.0.0.0:9876/
12 06 2019 11:20:45.650:INFO [launcher]: Launching browsers CustomElectron with concurrency unlimited
12 06 2019 11:20:45.664:INFO [launcher]: Starting browser Electron 
12 06 2019 11:20:46.030:ERROR [launcher]: Cannot start Electron
12 06 2019 11:20:46.030:ERROR [launcher]: Electron stdout:
12 06 2019 11:20:46.030:ERROR [launcher]: Electron stderr:
12 06 2019 11:20:46.105:INFO [launcher]: Trying to start Electron again (1/2).

Reproduction
(1) Clone https://github.com/Jusonex/karma-electron-testapp
(2) npm install
(3) npm test
The mentioned repository contains only a default Angular installation and https://github.com/Jusonex/karma-electron-testapp/commit/66a173d8ffb3d220cd8ba4b24d0fc5f81e14ad25.

Additional Notes

@twolfson
Copy link
Owner

The provided repo seems to be missing preprocessors and client.useIframe as documented in our README. Can you try adding those?

https://github.com/twolfson/karma-electron/tree/6.1.1#getting-started

https://github.com/Jusonex/karma-electron-testapp/blob/66a173d8ffb3d220cd8ba4b24d0fc5f81e14ad25/src/karma.conf.js

Closing issue pre-emptively

@jushar
Copy link
Author

jushar commented Jun 13, 2019

Actually, I already have those flags in my production app.

I also added them to the testapp (https://github.com/Jusonex/karma-electron-testapp/commit/5dfe5f9fcd6e22f1e095de546f81bfee833bf298) now, but the issue remains the same.

The same applies to #41.

@twolfson
Copy link
Owner

Ah, I understand the issue now. Sorry for jumping to that assumption. I don't have time to clone/install/etc the test repo at the moment. I'm pretty confident this is a path issue inside the test repo as we have a test for require:

https://github.com/twolfson/karma-electron/blob/6.1.1/test/integration-test/karma.conf.js#L73-L76

Can you mess around with the path some more? e.g. Debug what path we think it should load vs the one it's receiving

@twolfson
Copy link
Owner

After releasing extended webPreferences support, we discovered that Windows had an issue with any spawn parameters after a URL (e.g. http://localhost:3000/?1234) for Electron@3 and later. This only showed up due to usage with require previously which would append a --require parameter after the URL parameter

We've patched this issue and released it in 6.3.0. Sorry for the inconvenience and thank you for your attempt to report it

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

No branches or pull requests

2 participants