Isn’t this then a BrowserSync issue and a new issue should be created in BrowserSync GitHub repo?
An URL should be normalized (extra slashes removed) or at least those extra slashes ignored and not resulting in completely counterproductive behaviour, like endless refresh loops?
It also took me a loooong time and I refused to think my config was wrong but indeed it was.
Even though I used a docker image to spin up wordpress and the relative path would be sth. like "/themes/my-theme" I needed to set the public path like this instead:
I thought the path must be correct otherwise it wouldn’t be able to work at all but it really only happened sporadically and changing the path fixed the issue permanently to me. I think this is more or less what already has been said in this thread but tribble check your publicPath (especially when using docker)!
For new projects I shifted to Valet instead of docker and this works out of the box now Hope this may help you @dangelion.
Started a new project today and as usual it happens this issue, that makes development a pain in the ass. Like always I checked all and all and all again and again and obviously publicPath is one the first thing I checked and it was always correctly set ("/wp-content/themes/my-theme"). Finally as always the only thing it seems to solve is what I wrote here:
Is this Sage 9.x? In this case an update was recently merged that should fix most or all issues,
is your theme Sage 9.x based and have you updated your theme?
For me, the issue was with a caching plugin (Hummingbird). Use the caching plugin to clear your cache or simply disable it and it should resolve the infinite reloading.