Search code examples
javascriptseleniumelectronselenium-chromedriverelectron-packager

Chrome driver not working when extracting electron package using --asar


I am using electron for writing a desktop application using visual studio code and I have chromedriver included in my application

When I using the following command electron-packager . for extracting electron package , the output is uncompressed files and in this case chromedriver is working normally

But when using the following command electron-packager . --asar, the output is a compressed package and in this case chromdriver is not working as expected and I am getting the following error when running my application

Error screenshot


Solution

  • In case of running a compressed package, code is not able to find chromedriver.exe file

    For solving this, I added chromedriver.exe file to a folder and pointed to its path in the code In case of running a compressed package, code is not able to find chromedriver.exe file

    Chromedriver.js code