M
M
Maxim2021-03-05 16:05:49
JavaScript
Maxim, 2021-03-05 16:05:49

Why does Nuxt show an error in the Google console autocomplete?

in nuxt.config I connect the script for google autocomplete

script: [
      {
        src:
          'https://maps.googleapis.com/maps/api/js?libraries=places&key=AIzaSyAwGvEKJ0MwzoaXGvdh1jX8-HQryAA',
      },
    ],


On the registration page, I want Google to help when entering the address

<div class="auth-form__group">
          <label for="">Адрес магазина</label>
          <input ref="addorigin" type="text" class="form-control" />
        </div>


mounted() {
    window.google.maps.places.Autocomplete(this.$refs.addorigin)
  },


but in the console it gives

js?libraries=places&key=AIzaSyAbLpRwJ0MwzoaXGvdh1jX8-HQryAA:20 Uncaught (in promise) TypeError: c.setValues is not a function
    at js?libraries=places&key=AIzaSyAbLpRwJ0MwzoaXGvdh1jX8-HQryAA:20


google included only this
60422da45b67a411427264.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question