question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Browser-sync with Rails and turbolinks give white page

See original GitHub issue

I have setup browser-sync gulp plugin in my rails project and I had a white page issue when using turbolinks navigation. If I look at the source code, the page is properly sent to the browser but is not displayed.

Here is my browser-sync gulp code:

gulp.task 'init', ->
  browserSync.init
    proxy: '127.0.0.1:3000' # Rails server
    port: 3001
    open: false
    notify: false
    ui: false

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:8
  • Comments:21 (2 by maintainers)

github_iconTop GitHub Comments

20reactions
sudomfcommented, Jul 31, 2016

@mrkongo @sandrodz @anthony-robin and other guys, I found a way to fix this issue. Browsersync injects a script in html page inside body tag, that causes the issue, so I changed some settings in Browsersync to inject script at head tag instead of body tag.

snippetOptions: {
      rule: {
        match: /<\/head>/i,
        fn: function (snippet, match) {
          return snippet + match;
        }
      }
    }

Hope that it can help you 😄

5reactions
sandrodzcommented, Apr 6, 2016

Good workaround but, actually fixing this would be awesome!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Browser-sync with Rails and turbolinks give white page -
I have setup browser-sync gulp plugin in my rails project and I had a white page issue when using turbolinks navigation. If I...
Read more >
Rail 6 app, navigating to link is taking me to blank page and ...
All, i am facing an issue with routing when i click on the link i am taking to a blank page and only...
Read more >
Gulp And Browsersync Configuration With Mamp - ADocLib
I have setup browsersync gulp plugin in my rails project and I had a white page issue when using turbolinks navigation. If I...
Read more >
How to use Browser Sync in Rails - Reyza's Docs
If you would like to run Browsersync from the command line in any directory, it can be installed globally with the following command....
Read more >
Hasty Treat - Old Browsers, Fallbacks and Polyfills - Part 1
Full Stack Developers Wes Bos and Scott Tolinski dive deep into web development topics, explaining how they work and talking about their own...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found