Static GitHub Issues

[3118] vue-meta script is not loaded before mounted

prev: Explicitly choose where the page is rendered
next: Feature request: Brotli compression with GZIP fallback

I'm using this to autocomplete addresses through google map API. It's not ssr compatible so it's loaded through a ssr: false plugin.

I'm loading maps script from the page head:

head () {
  return {
	script: [
	  {src: 'https://maps.googleapis.com/maps/api/js?key=API_KEY&libraries=places'}
	]
  }
}

Now when the component is mounted, google is not defined meaning that the script is not loaded.

Moving the script to the layout helps when the related page is not the first loaded, but fails the same way otherwise.

Any suggestion to work around this?

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c2700">#c2700</a>)</em></sub></div>