Error when trying to run php artisan dusk
. A Chrome version error happened. I Google the error and took a quick look in a couple of websites including Laracasts and the Dusk Github issues.
Solved after running php artisan dusk:chrome-driver
Hopefully this helps someone else.
I found that my issue was:
Facebook\WebDriver\Exception\SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 84
The Fix
I found the fix here https://barryvanveen.nl/blog/61-how-to-fix-common-laravel-dusk-problems
First run:
chromium-browser --version
Then after you find out your version from that run:
php artisan dusk:chrome-driver yourversion
Hope this helps someone else, as I was looking for an answer for a couple hours.
Solved after running the below command
php artisan dusk:chrome-driver --detect
Note: If you get the below error after running the above command
Failed to connect to localhost port 9515: Connection refused
then, restart your chrome browser and check it. It will solve that error. Hope it helps
For anyone running into this issue on Chrome/Chromium versions after 114, this is likely caused by Google changing the upstream URLs.
This seems to have been fixed in this Dusk issue here, so theoretically all that's needed to fix this properly is a composer require laravel/dusk --with-all-dependencies
, but at least in my case, this would update a lot of dependencies and seems highly likely to break my application. I've asked on that issue what the best course of action is for a legacy Laravel application (Laravel 8 in my case), but in the meantime downgrading both the Chrome/Chromium browser and the Chrome driver to v114 should be a good enough workaround.
This is easier said than done and it's taken me over a day to figure out how to do it successfully on GitHub Actions, but adding the following step to your workflow file should be all you need to get your builds running again:
- name: Downgrade Chrome browser to v114
uses: browser-actions/setup-chrome@v1
with:
chrome-version: 1134343 # Last commit number for Chrome v114
id: setup-chrome
- run: sudo ln -fs ${{ steps.setup-chrome.outputs.chrome-path }} /usr/bin/google-chrome
- name: Downgrade Chrome driver to v114
run: php artisan dusk:chrome-driver `/usr/bin/google-chrome --version | cut -d " " -f3 | cut -d "." -f1`
© 2022 - 2024 — McMap. All rights reserved.