browser-sync-rails icon indicating copy to clipboard operation
browser-sync-rails copied to clipboard

port/reload issue on selecting new route

Open millerthegorilla opened this issue 7 years ago • 0 comments

Hi, I'm using browser-sync-rails with rails 5 through chrome and when I select a new route using link_tag the new page does not load and the screen is white. I had to install browser-sync manually through npm -g. I then ran bundle exec rails generate browser_sync_rails:install and the config/browser_sync.yml file was empty, so I put the following into it:

`host: 'localhost'

port: '3000'`

I am now getting the site starting at localhost:3001 and this problem with page load although the page appears if I use reload, and when I make changes to the file these are persisted to the browsers. The issue does remind me a little of when I manually attempted to place browser-sync with gulp, and attached the script that browsersync uses using style tags in the view.

In the console I have the following errors reported:

http://localhost:3001/assets/turbolinks.self-c5acd7a204f5f25ce7a1d8a0e4d92e28d34c9e2df2c7371cd7af88e147e4ad82.js?body=1 -- Uncaught TypeError: Cannot read property 'querySelector' of null

http://localhost:3001/browser-sync/browser-sync-client.js?v=2.17.2:formatted -- Uncaught TypeError: Cannot read property 'data1476175479560' of null

Perhaps, it might be a css issue, but I am not certain why the yml config file should be empty, and also why, despite configuring 3000, it appears on 3001 (although it reports proxying 3000). Perhaps I can turn proxying off as I am not running the site through apache or nginx, and just through rails server.

Can browser-sync be passed options like I would with gulp, regarding things like proxying?

Thanks.

millerthegorilla avatar Oct 11 '16 08:10 millerthegorilla