browser-sync: iPhone not able to access external URL
Everything is working great on desktop, but when using the external URL on my iPhone (Chrome, Safari) it just loads for a minute then say’s it can’t access the page. I have another machine that I’m using this exact setup on and it loads fine on my iPhone so I’m at a loss. Gulp file below:
var gulp = require('gulp'),
sass = require('gulp-sass'),
prefix = require('gulp-autoprefixer'),
rename = require('gulp-rename'),
browserSync = require('browser-sync'),
reload = browserSync.reload;
var paths = {
styles: {
src: './bower_components',
files: './modules/**/*.scss',
}
}
var displayError = function(error) {
// Initial building up of the error
var errorString = '[' + error.plugin + ']';
errorString += ' ' + error.message.replace("\n",''); // Removes new line at the end
// If the error contains the filename or line number add it to the string
if(error.fileName)
errorString += ' in ' + error.fileName;
if(error.lineNumber)
errorString += ' on line ' + error.lineNumber;
// This will output an error like the following:
// [gulp-sass] error message in file_name on line 1
console.error(errorString);
}
gulp.task('sass', function (){
gulp.src(paths.styles.files, {base: '.'})
.pipe(sass({
sourceComments: 'map',
errLogToConsole: true,
includePaths : [
paths.styles.src,
paths.styles.src + '/bootstrap-sass/assets/stylesheets',
]
}))
.on('error', function(err){
displayError(err);
})
.pipe(prefix(
'last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4'
))
.pipe(rename(function(path) {
path.dirname = path.dirname.replace('/sass', '/css');
path.extname = '.css';
}))
.pipe(gulp.dest('.'))
.pipe(reload({stream: true}));
});
gulp.task('default', ['sass'], function() {
browserSync({
proxy: "http://localhost/ADGA/"
});
gulp.watch(paths.styles.files, ['sass'])
.on('change', function(evt) {
console.log(
'[watcher] File ' + evt.path.replace(/.*(?=sass)/,'') + ' was ' + evt.type + ', compiling...'
);
})
.on('change', reload);
});
About this issue
- Original URL
- State: open
- Created 9 years ago
- Reactions: 3
- Comments: 36
(SOLVED) Really! Weird thing, but it solved my problem. So, the solution is:
Solved on WIN10 by allowing Node.js:Server-side Javascript on “Private” network in “Control Panel\System and Security\Windows Firewall\Allowed applications”
For me, the IP showing by BrowserSync was different than my real one. Just leaving the comment here if someone’s fail on the same thing (Windows 10, by network, on a Moto G4 Plus).
+1 , I have the same issue as well. The external Url is not usable on iphone safari/chrome or ipad
@philgruneich If you’re still having this issue, I found my solution by opening TCP Port 3000 in Windows Firewall thanks to this issue: https://github.com/Microsoft/BashOnWindows/issues/2054. A quick google of how to open a port and my browser sync was once again accessible from my mobile devices. Hope that might help you, too. 😃
Just fixed this for me by turning my firewall on and allowing connections to node.
@giovannipds I wish it was that simple; but Node.js is not listed among applications since I installed it on Bash only using n; so I don’t have a clue how to allow it 😦
@jdkarns This was on a Macbook, I just went to firewall (it was off) and switched it on. It asked if I should allow connections to node and I said yes. Hasn’t worked consistently though unfortunately.
Same problem for me, all my projects stopped working on iphone. Using OSX and firewall is off
+1, both iPhone and iPad unable to access the external url. The tunnel url seems to work fine though.
Multiple network interfaces was my issue as well. If I check “ipconfig”, browser-sync was reporting the “VirtualBox Host-Only Network” as my ip address. So naturally that’s what I typed on my phone…
If you have virtualbox, this may be the issue.
In macOS: Security & Privacy > Firewall > Firewall Options Find
nodeand make sure it’s set toAllow incoming connectionsIn my case it was set toBlock incoming connectionsso that fixed my issue.I still can’t get it to work for me 😦
I tried:
This stack overflow post suggests Avast might be interfering but I don’t have Avast installed https://stackoverflow.com/questions/50397030/browsersync-dont-work-external-link
I have Malwarebytes installed on my computer, I tried turning that off in case that was messing with things. Still no luck. 😦
This is on a Samsung Galaxy S7, not an iPhone.
Ah sorry, forum newbie. Thanks @giovannipds!
I have the same problem but on my Android Note 4. I tried Chrome, Native Samsung Browser and Firefox and none will access the URL. It works fine on my Nexus 7 tablet. I hope we can find a fix. Thank you
This is an old problem I had that has since been resolved, will close this out today. I wrote a blog post about getting set up with Browsersync and Grunt if anyone is interested: https://webdevstudios.com/2015/08/18/testing-websites-real-devices-browsersync/
Also, here’s my current Gruntfile if anyone wants to take a look at it for reference. Browsersync stuff is on line 255 and 293.