Home

Issue: 3118

vue-meta script is not loaded before mounted

[issue link]

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?

This question is available on Nuxt.js community (#c2700)