@pepsiisbetter are you sure you already run php artisan dusk:chrome-driver ?
run Dusk on Ubuntu20+VScode+DevContainer (Failed to connect to localhost port 9515 )
Hi,
I develop a local laravel project on Ubuntu20+VScode+DevContainer, by the official install instruction
After I followed the document to install Dusk, and then it run failed, but there is no article completely solve my problem.
The error messages are "Failed to connect to localhost port 9515: Connection refused" or something else which I don't remember...lol, because I have tried too many things.
After combined many solutions, the dusk run successfully on my computer.
so I post my solution here(all necessary settings) to help anyone who use the same environment.
.env
APP_ENV=local
APP_DEBUG=true
APP_URL=http://myproject.test
DUSK_DRIVER_URL=http://selenium:4444
devcontainer.json
"service": "myproject.test",
docker-compose.yml
services:
myproject.test:
depends_on:
- selenium
selenium:
image: 'selenium/standalone-chrome'
volumes:
- '/dev/shm:/dev/shm'
networks:
- sail
If even you used php artisan dusk:install and php artisan dusk:chrome-driver and received the ChromeDriver binaries successfully installed message, but still had the connection refused error or other chrome related error, then you may add the script into your Dockerfile
RUN curl -O https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
&& dpkg -i google-chrome-stable_current_amd64.deb; apt-get install -y -f \
&& rm -f google-chrome-stable_current_amd64.deb
If you have Telescope installed and have Class env does not exist ploblem.
replace the line in the App\Providers\TelescopeServiceProvider.php
Telescope::filter(function (IncomingEntry $entry) use ($disableFilter) {
if ($this->app->environment('local')) { // change this line
return true;
}
//
});
to this
$disableFilter = $this->app->environment(['local', 'testing']);
Telescope::filter(function (IncomingEntry $entry) use ($disableFilter) {
if ($disableFilter) {
return true;
}
//
});
Please or to participate in this conversation.