title: Why is Vue not initialized?
body: <p>I have a Rails application. Sometimes on the pages I place Vue components. It can be as simple dynamic lists. But there can also be a more complex implementation with many components nested in each other.</p>
  
  <p>First, I'll show you how it all works (code).</p>
  
  <p>Part of the code from the main layer in a Rails application:</p>
  
  <pre><code>body
    #app
      = yield
  </code></pre>
  
  <p>And part of the code from JS:</p>
  
  <pre><code>if (document.getElementById('app')) {
    new Vue({
      el: '#app',
  </code></pre>
  
  <p>And now about the problem.</p>
  
  <p>Sometimes, when I open the browser, then I loaded the page without Vue components. This issue is equally relevant in macOS Chrome / Safari and iOS Safari. But if I manually reload the page, then everything is fine.</p>
  
  <p>What could be the problem? Why does the browser quickly load a page after launch (probably from a cache?) and reacts poorly to Vue?</p>