BrowserSync / grunt-browser-sync

Grunt Task for keeping multiple browsers & devices in sync when building websites.
MIT License
418 stars 44 forks source link

browser-sync not working with mamp pro #80

Closed nricca closed 9 years ago

nricca commented 9 years ago

Hi everyone,

i'm very excited to use browser-sync but unfortunately i cannot make it work with mamp pro.

My webiste is accessible via the url : http://fundeego.dev:8888 but nothing is diplayed via the localhost:3000, the name is not resolved and via the external url, the page is displayed but it took forever to load the content.

Here is my conf :

    browserSync: {
            default_options: {
                bsFiles: {
                    src: [
                        "app/assets/css/*.css'",
                        "app/*.html"
                    ]
                },
                options: {
                    watchTask: true,
                    proxy: "http://fundeego.dev:8888/"
                }
            }
        }

Here is the hosts file edited by mamp pro :

127.0.0.1   Riccas-MacBook-Pro.home # MAMP PRO - Do NOT remove this entry!
::1     Riccas-MacBook-Pro.home # MAMP PRO - Do NOT remove this entry!
fe80::1%lo0 Riccas-MacBook-Pro.home # MAMP PRO - Do NOT remove this entry!
127.0.0.1   fundeego.dev    # MAMP PRO - Do NOT remove this entry!
::1     fundeego.dev    # MAMP PRO - Do NOT remove this entry!
fe80::1%lo0 fundeego.dev    # MAMP PRO - Do NOT remove this entry!

Thanks for your help

hugooliveirad commented 9 years ago

1) Can you try using this config:

options: {
  watchTask: true,
  proxy: "fundeego.dev:8888"
}

2) or serve via :80 and omitting the port?

options: {
  watchTask: true,
  proxy: "fundeego.dev"
}

If 1 fails and 2 works, we may have to take a look in this bug.

sollenne commented 9 years ago

+1 for this issue. Any luck getting it working like this @nricca ?

nricca commented 9 years ago

Nope, didn't work with both options. It's work very well outside of mamp, so I go back with livereload for this specific projet. Thanks anyway

danielkoch commented 9 years ago

Are there any news on this issue?

jimlakey commented 9 years ago

why was this issue closed? It does not seem to have been resolved, unless I'm missing something. I'm having the same trouble with the latest version of BS.

Any help would be appreciated!

shakyShane commented 9 years ago

@jimlakey we'll happily reopen the ticket if someone could be kind enough to share a sample project that demonstrates the issue :)

jimlakey commented 9 years ago

I'd be glad to, but you'll have to spell it out for me I'm afraid. What do I need to provide in a sample to show the issue?

shakyShane commented 9 years ago

Reproduce the bug in as little code as possible (could be an simple php file, or an entire framework) - include how you use BrowserSync (gulp, grunt, cli etc) - basically just create a repo that I can clone and see the issue. also as much Mamp config info as possible would be great.

jimlakey commented 9 years ago

I started building out a test case and came across the issue I was encountering while doing it. The issue I had was that I was trying to run grunt browserSync with watchTask: true set in the config. I then figured I'd run grunt watch afterwards. Instead I made by default grunt task grunt.registerTask('default', ['browserSync', 'watch']); and then just run grunt on the command line and now it all works fine.

So I wonder if other people had a similar issue with the watchTask: true flag set but then not running the watch task at the same time, or in the wrong order. I'd read http://www.browsersync.io/docs/grunt/#grunt-watch but I didn't see that as the issue at the time!

shakyShane commented 9 years ago

@jimlakey this is precisely why we suggest creating a reduced test case - often you can discover/fix problems on your own :)

jimlakey commented 9 years ago

I feel like there should be some kind of "teach a man to fish" type of wisdom-nugget here, but it's escaping me... Thanks Shane!