-
Notifications
You must be signed in to change notification settings - Fork 120
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
Cannot start ChromeHeadless in Angular project, WSL #214
Comments
I also have this issue. But apparently we are edge cases... |
same issue... |
@eprokhor The problem is development is extremely limited in WSL2. You have to put your project's files in your Linux system's home directory(the mounted filesystem no longer works( I created a projects directory in my home directory: |
I'm having the same problem right now. Has anyone figured out any workarounds in the meantime? |
Hi @JoannaFalkowska I don't think there is much of a workaround due to how WSL 2 is designed. It's fundamentally different than WSL 1 because you need to work directly inside of the virtual Linux environment. If you don't everything is extremely slow and you run into issues like this one. In other words you need to serve your app directly from the Linux environment ( I ended up reverting back to WSL 1 for now because I don't see WSL fixing this anytime soon. |
@mfish0005 I reinstalled WSL 2 and tried to go the virtual Linux environment only. Turns out there is |
@zwarag Interesting. I had a similar setup going but it was so painfully slow(minimum 30 sec compile times) that it was unusable for me. Maybe they did some optimization. I should test it out and see |
To make this run successfully, Please follow the procedure Method 1: Most of the issues will be fixed and we can run ChromeHeadless if we download chromium version(debian) in wsl and install step 1: install necessary packages
step 2: install chromium
If still problem persists, please follow the method 2 method 2: To run a basic Selenium UI test on any environment we need a browser and a driver to control the browser. step 1: Link Chrome browser on Windows
step 2: Link chromedriver on Windows
step 3: Change CHROME_BIN (environmental variable's default value)
If still problem persists, please follow the method 3 Method 3: This will help run puppetteer on Ubuntu, so let's install necessary packages:
|
thank you for the post @actionanand i appreciate it, hope it leads to some success! i am no longer using WSL/Windows at all so i have not been following this issue anymore, my apologies. |
Method 2 worked for me, however, I had to not use |
@zwarag I resolved the issue by removing the $DISPLAY variable in my .zshrc file. Cypress depends on the Xserver which is why that variable was set. Now I am trying to figure out how I can make both cypress and chromeHeadless play together. I don't want to rely on additional configuration to keep karma happy. |
Method 2 worked for me. I've just replaced path 'Program Files' to without (x86) |
Thanks, method 3 worked for me (WSL 2). |
Method 2 Step 3 was the only required step for me. Steps 1 and 2 were not needed. I had to make one small change to the path, since my executable was in |
Happy that you found it working. Happy coding 🥇 |
Two things: |
I'm using Windows Subsystem for Linux (Windows 10, Ubuntu 18.04 LTS). I'll list all the other pertinent versions below.
This setup is working on my Mac machine, without the
flags
array added tokarma.conf.ts
as shown below.So far I've looked at: Headless Chrome slows tests by 10x, rebuilding yarn project using
npm rebuild --update-binary
, #175, #198Expected Behaviour
To launch ChromeHeadless and run the tests
Current Behaviour
Running
yarn test
as I would normally results in this error:and after
ctrl+c
...The file
/tmp/ng-GhKvib/angular-errors.log
containsAn unhandled exception occurred: Cannot destructure property
errorof 'undefined' or 'null'.
.Karma Config
The command that
yarn test
runs isng test --karmaConfig=karma.conf.ts
.Versions
yarn=1.19.0
angular-cli=8.3.2
karma=4.1.0
karma-chrome-launcher=2.2.0
tsc=2.7.2
The text was updated successfully, but these errors were encountered: