BrowserSync / browser-sync

Keep multiple browsers & devices in sync when building websites. https://browsersync.io
https://discord.gg/2d2xUThp
Apache License 2.0
12.14k stars 754 forks source link

Browser Sync not Updating PHP outside BODY + Certificate Issues #2070

Open xcrap opened 3 weeks ago

xcrap commented 3 weeks ago

Issue details

I was searching for an alternative for Live Sync / Refresh my Local Development, I've been using Codekit / PrePros in the latest years but wanted to have something lighter and simpler. I'm was trying browser-sync with my local server and two issues happens:

1 - The live reload works if I make changes inside or , but If I make changes for example... <?php echo 'testing'; ?> in the top of a file before any html tag it refreshes once and then the b_s_script if no longer injected, I have to do a hard refresh... so editing php inside elements and et works, outside it refreshes the first time and the script is no longer injected and everything stops working, even in the CLI says Reloading Browsers. I don't understand but using --no--inject-changes should not just refresh everything on file change, I'm not sure why it needs to inject the script with that option.

2 - Certificate. I've installed a certificate, it was not working, I've deleted the files, created a new one, I've added to the Keychain access, already set to Trust and I've added the certificate in "login" but i also tried in "System". I always get an invalid certificate, the funny thing is that it points me to the first certificate I've created and not the last one, even the first does not exists, yes I've restart the computer, cleaned the cache, flushes the dns but the issue persists, so it's very very strange.

Any ideas on any of those subjects ?

Please specify which version of Browsersync, node and npm you're running

Affected platforms

Browsersync use-case

If CLI, please paste the entire command below

browser-sync start --ws --no-inject-changes —no-notify --proxy "https://website.local" --https --key "$HOME/Documents/LocalCertificates/bs-key.pem" --cert "$HOME/Documents/LocalCertificates/bs-cert.pem" --files "$HOME/htdocs/website//*.php, $HOME/htdocs/website/*/.css, $HOME/htdocs/website//*.js" —log-level “debug” —host “https://website.local