Common Issues
These are some common issues which others have encountered whilst using the service. For debugging tools and features, see the Debugging guide.
CDP bridge cannot be initialized: EnableNodeCliInspectArguments fuse is disabled
This warning appears when your Electron app has the EnableNodeCliInspectArguments fuse explicitly disabled. The CDP (Chrome DevTools Protocol) bridge relies on the --inspect flag to connect to Electron's main process, so when this fuse is disabled, the service cannot provide access to the main process APIs.
Impact
When this fuse is disabled:
- ❌
browser.electron.execute()- main process API access will not work - ❌
browser.electron.mock()- mocking main process APIs will not work - ❌ Main process log capture will not work (see Debugging - Log Capture Requirements)
- ✅ Renderer process testing continues to work normally
- ✅ Renderer process log capture continues to work (uses Puppeteer, not CDP bridge)
- ✅ Service initialization continues normally - no crashes or failures
- ✅ Clear error messages when attempting to use disabled APIs
Solution
Enable the fuse in your test builds. If you're disabling this fuse for production (which is good security practice), use conditional configuration:
import { flipFuses, FuseVersion, FuseV1Options } from '@electron/fuses';
await flipFuses(require('electron'), {
version: FuseVersion.V1,
[FuseV1Options.EnableNodeCliInspectArguments]: process.env.BUILD_FOR_TESTS === 'true',
// ... other fuses
});
Then build with the environment variable, e.g.:
BUILD_FOR_TESTS=true npm run build # for testing
npm run build # for production
See: Electron Fuses Documentation
DevToolsActivePort file doesn't exist
This is a Chromium error which may appear when using Docker or CI. Most of the "fixes" discussed online are based around passing different combinations of args to Chromium - you can set these via appArgs, though in most cases using xvfb has proven to be more effective; the service itself uses xvfb when running E2Es on Linux CI.
See this WDIO documentation page for instructions on how to set up xvfb.
Note: WebdriverIO 9.19.1+ is required for automatic Xvfb support via the autoXvfb configuration option. For legacy WDIO versions, you'll need to use external tools like xvfb-maybe or manually set up Xvfb.
Failed to create session. session not created: probably user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir
This is another obscure Chromium error which, despite the message, is usually not fixed by providing a unique --user-data-dir value. In the Electron context this usually occurs when the Electron app crashes during or shortly after initialization. WDIO / ChromeDriver attempts to reconnect, starting a new electron instance, which attempts to use the same user-data-dir path. Whilst there may be other causes, on Linux this is often fixed with xvfb.
See this WDIO documentation page for instructions on how to set up xvfb.
Note: WebdriverIO 9.19.1+ is required for automatic Xvfb support via the autoXvfb configuration option. For legacy WDIO versions, you'll need to use external tools like xvfb-maybe or manually set up Xvfb.
All versions of Electron fail to open on Ubuntu 24.04+
See this issue for more details. This is caused by AppArmor restrictions on unprivileged user namespaces.