title: Navigate with nuxt-link to anchor/hash on different page causing problems
body: <p>I am using nuxt-links in my website navigation, most of them point to hashed elements/anchors in the home page like:</p>
  
  <pre><code>&lt;nuxt-link
    v-else
    class="text-link"
    :to="localePath('index') + `#${item.hash}`"
  &gt;
  </code></pre>
  
  <p>and it does its job if currently on the home page but when I navigate to a different site, eg. /about and I click on a navbar nuxt-link (so I want to navigate from /about to /#hash or /any-other-site#hash) I got a nuxt error displayed to check the console where it reads "Cannot read property 'offsetTop' of null"</p>
  
  <p>My router configuration in nuxt.config (without it I wouldn't be even able to scroll to an anchored element being in the same site as the element!):</p>
  
  <pre><code>  router: {
      scrollBehavior(to) {
        if (to.hash) {
          return window.scrollTo({ top: document.querySelector(to.hash).offsetTop + window.innerHeight, behavior: 'smooth' });
        }
        return window.scrollTo({ top: 0, behavior: 'smooth' });
        }
    },
  </code></pre>