Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get Chrome on Android to auto-refresh #13

Closed
humanaut opened this issue Apr 24, 2014 · 3 comments
Closed

Unable to get Chrome on Android to auto-refresh #13

humanaut opened this issue Apr 24, 2014 · 3 comments

Comments

@humanaut
Copy link

Hello,

I have used the configuration settings in the readme. I am able to compile and auto-refresh my browser on my local machine as expected.

When I navigate to my site on my Nexus 5, it takes a very long time for even a simple page to load up. I also don't get any browser refreshing.

I am using the static server option to at least be able to use it on my local machine, so it generates a url for me: 10.10.10.xxx:xxxx.

When I access the site on my device via wifi, I use my machines wifi address, via 172.x.x.xxx:xxxx etc.

I tried the proxy server version also, but I couldn't get that to work even locally. It refused to load a browser window with my defined .dev address, it just opened a browser with the my local machine IP address again.

I can provide any other details if requested, not sure what else might help.

Thank you.. and thanks for building this!

@shakyShane
Copy link
Contributor

Is it regular HTML files that you're trying to serve?

@humanaut
Copy link
Author

Yes, just an index.html page.

I am using gulp-ruby-sass instead of gulp-sass now also, but that didn't change anything.

I usually access my local sites via a virtual host entry and access it on any device on my wifi network (so test.dev via the local machine, and 172.etc on my device)

Would it have anything to do with the IP address difference? As mentioned, I access the site on the local machine with it's local 10.10.10.xxx:xxxx address when using Gulp/BS, but on the other devices I have to use my machines wifi address (172. etc). I can't access the site from my android device using the 10.10 address, so maybe that's why.

edit: Here is my configuration file

var gulp = require('gulp');
var sass = require('gulp-ruby-sass');
var browserSync = require('browser-sync');

gulp.task('sass', function () {
    gulp.src('sass/theme.scss')
        .pipe(sass({bundleExec: true}))
        .pipe(sass({sourcemap: true}))
        .pipe(gulp.dest('stylesheets'));
});

gulp.task('browser-sync', function() {
    browserSync.init(["stylesheets/*.css", "js/*.js"], {
        server: {
            baseDir: "./",
        },
        open: false
    });
});

gulp.task('default', ['sass', 'browser-sync'], function () {
    gulp.watch("sass/*.scss", ['sass']);
});

I should also add, I'd prefer to use my virtual host address that I set up for each site on my local machine. in this instance, I was just trying the bare minimum setup to test out the build tools, so I am not using a local .dev test address, even though I for my guard setups (Drupal sites)

@humanaut
Copy link
Author

After a few more hours of tweaking, I have realized that it is not an issue with browser-sync.

It's not refreshing on my mobile device because the system uses my machines LAN address to serve up the browser-sync files, so the mobile device doesn't know about that address and the src of the sync files. If I unplug my machine and just use my iMac's wifi, the files get served with WiFi address and therefore my device which connects to my machine via the iMacs WiFi, get's the auto refresh and other features.

So everything works fine as it should.

I was trying to re-create my Guard + LiveReload setup while working on a Drupal theme with Gulp + Browser-Sync.

Basically, access the site on my local machine using a test.dev address and get auto refreshing after compiling. On my mobile device, I have to access the site via the iMacs WiFi address + port number (as per usual) and I still get auto refreshing. So really right now the only difference is that with Browser-sync I can't seem to figure out how to access my site via the test.dev address and still get browser refreshing.

Not a request or anything, but I was just looking through how Drupal Aurora Theme (https://drupal.org/project/aurora) does it and it seems to manipulate the ip address for the source files so that I can still access it via the test.dev address. Here is just a snippet https://www.dropbox.com/s/93irc0bxyogkj0f/Screenshot%202014-04-29%2009.45.32.png

If there is a way to still let a developer use the test.dev address AND get auto-refreshing, that would be a start.

Closing, and thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants