Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Lukebouch's avatar

Dusk Connection Refused

I'm so confused, I was working on my laravel app and a made a few changes that cause the application to take forever to respond and it would only render out part of the page. It has something to do with Bouncer (the permission package). I revert to a previous commit that was working fine yesterday and tests were passing but when I run `php artisan dusk', every test fails and this is what I get:

Failed to connect to localhost port 9515 after 0 ms: Connection refused

/Users/lukebouch/the-prayer-platform/vendor/php-webdriver/webdriver/lib/Remote/HttpCommandExecutor.php:332
/Users/lukebouch/the-prayer-platform/vendor/php-webdriver/webdriver/lib/Remote/RemoteWebDriver.php:135
/Users/lukebouch/the-prayer-platform/tests/DuskTestCase.php:46
/Users/lukebouch/the-prayer-platform/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:218
/Users/lukebouch/the-prayer-platform/vendor/laravel/framework/src/Illuminate/Support/helpers.php:234
/Users/lukebouch/the-prayer-platform/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:219
/Users/lukebouch/the-prayer-platform/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:97
/Users/lukebouch/the-prayer-platform/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:65
/Users/lukebouch/the-prayer-platform/tests/Browser/ProfileTest.php:67

ERRORS!
Tests: 10, Assertions: 0, Errors: 10.

This has got me so confused because when I login to the application running through valet, everything works fine! Any ideas?

0 likes
7 replies
bugsysha's avatar

Have you tried looking at other discussions with the same issue? Bunch of those here on Laracasts and on Google.

Lukebouch's avatar

@bugsysha I saw one but it was regarding a slightly different situation. I will look again

1 like
Lukebouch's avatar
Lukebouch
OP
Best Answer
Level 3

I installed Chromium through Homebrew and then ran php artisan dusk:install which fixed it. I don't think chromium had anything to do with it. I think I just needed to reinstall dusk.

3 likes
efcor's avatar

I am sorry in advance if this is bad etiquette to reply to this thread after a year, but I wanted to write my first post in this forum just to confirm this solution solved this same issue for me in Sep 2022. Thanks so much!

Lukebouch's avatar

@efcor I don’t know the etiquette either but personally, I’m glad you replied. Good to hear it helped you!

Please or to participate in this conversation.