Hope it helps! it's working with me
mix
.js("resources/js/app.js", "public/js")
.sass("resources/sass/app.scss", "public/css")
.browserSync({
proxy: 'localhost', // your domain test
port: 32816 // your port
});
Just started using laravel sail and can't make browsersync work. It does'nt reload the browser
mix.browserSync({
open: false,
notify: false,
proxy: 'http://iskelbimai.test',
port:8084
});
Any solutions?
I initially ran npm inside the terminal (WSL2/Ubuntu). For installation npm install works just fine. But npm run watch always resulted in an "Unhandled error event", "Error: listen ENOTSUP: operation not supported on socket".
I am working with Windows 10, Docker (WSL2 in an Ubuntu environment).
After searching I finally managed to get browserSync properly working with following config:
.browserSync({
host: '127.0.0.1',
proxy: 'localhost',
open: false,
files: [
'app/**/*.php',
'resources/views/**/*.php',
'packages/mixdinternet/frontend/src/**/*.php',
'public/js/**/*.js',
'public/css/**/*.css'
],
watchOptions: {
usePolling: true,
interval: 500
}
});
Install Node & NPM (Windows version). Reboot, open Windows PowerShell and make sure you can access npm -v and node -v in your project path. There you can run: npm run watch
Make sure your docker-project is up in the WSL2 terminal and over there run: sail up
Then open your browser, go to http://localhost:3000 and you're all set to go!
If you happen to have errors in PowerShell in the process, just delete the /node_modules folder completely. Reinstall it with npm install inside PowerShell instead and then try again. When the folder structure was downloaded earlier inside another environment (e.g. linux) and you use e.g. PowerShell now, I noticed that's commonly a cause. Reinstalling fixes the issue.
Please or to participate in this conversation.