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

vincent15000's avatar

ERR_CONNECTION_REFUSED with dusk

Hello,

I have already installed dusk in other projects and all worked fine.

Today I install dusk on a new fresh project and it doesn't work.

Here are the steps :

  • composer require laravel/dusk --dev

  • php artisan dusk:install

  • php artisan dusk:chrome-driver 119

  • php artisan dusk

I get this error message.

Tests\Browser\HomePageTest > open login modal                                                                                        UnknownErrorException   
  unknown error: net::ERR_CONNECTION_REFUSED
  (Session info: chrome=119.0.6045.159)

  at vendor/php-webdriver/webdriver/lib/Exception/WebDriverException.php:146
    142▕                     throw new UnexpectedAlertOpenException($message, $results);
    143▕                 case 'unknown command':
    144▕                     throw new UnknownCommandException($message, $results);
    145▕                 case 'unknown error':
  ➜ 146▕                     throw new UnknownErrorException($message, $results);
    147▕                 case 'unknown method':
    148▕                     throw new UnknownMethodException($message, $results);
    149▕                 case 'unsupported operation':
    150▕                     throw new UnsupportedOperationException($message, $results);

What am I doing wrong ?

Any idea to help me ?

Thanks a lot.

V

0 likes
2 replies
Braunson's avatar
Braunson
Best Answer
Level 18

Have you confirmed you are setting your .env APP_URL properly? Based on the error headless Chrome instance cannot access your Laravel app.

1 like

Please or to participate in this conversation.