Closed jushar closed 5 years ago
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
Closing issue pre-emptively
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.
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
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
Description After updating my application to Electron 5, I needed to use the workaround in https://github.com/twolfson/karma-electron/issues/38#issuecomment-491510277 to enable the nodeIntegration.
Unfortunately, I can't get the
require
field within thecustomLaunchers
property to work. It always just outputs: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
require
is an absolute path and definitely correctrequire('/absolute/path/to/file')
after https://github.com/twolfson/karma-electron/blob/master/lib/electron-launcher.js#L40-L42 it works