Open studentIvan opened 8 years ago
this solution helps me https://github.com/shakyShane/browser-sync-spa/issues/4#issuecomment-147371716
Developers??? Are you here???
I'm with the same problem. =/
I commented this line but now when I refresh any page like locahost:3000/register refresh than it gives error Cannot GET /register and page lost
I am seeing this same issue, but I believe the key is whether or not you are using Angular's HTML5 mode.
Browsersync + Browsersync-spa seems to correctly handle ghostMode: false
if you are using the default hashbang mode. But if you change Angular to run in HTML5 mode, Browsersync behaves as if ghostMode is turned on even if you have turned it off - i.e. navigation and clicks are mirrored across devices even when ghostMode is turned off.
studentIvan's solution is going to completely disable BrowserSyncSpa's ability to autoreload the page, so any page other than your application root will not be able to be refreshed.
// Not recommended
// browserSync.use(browserSyncSpa({
// selector: '[ng-app]'// Only needed for angular apps
// }));
Although its not a fix to the underlying problem, I believe I came up with a better workaround, which was to use hashbang mode on development and HTML5 mode on production. I used angular-environment to do this.
// inside angular config function
if (envServiceProvider.environment === "production") {
$locationProvider.html5Mode(true);
}
Did you try:
ghostMode: { clicks: true, forms: true, scroll: false }
hey guys, i tried with this and is working like a charm https://github.com/BrowserSync/browser-sync/issues/708
URL not found @codeyad
@aarongray solution works for me, but... it is not as good as fixing the browser-sync-spa issue. Same as @studentIvan I want to have normal html5 history api support for developing. This issue is more than one and a half years old, is there any chance to get it fixed?
I using browser-sync with gulp and angularjs. When I pass ghostMode: false to browser-sync settings, or disable it manually - it doesn't change ghost mode and still syncing all my actions. So, when I did comment this lines:
It began to work and my clicks/scrolls don't syncing now But i want to normal html5 history api support for developing =(