0

Im using vue to import google maps to my application

but it does not let me run my application once i import it.

import Vue from 'vue'
import App from './App.vue'
import * as VueGoogleMaps from "vue2-google-maps";

Vue.use(VueGoogleMaps, {
  load: {
    key: "",
    libraries: "places" // necessary for places input
  }
});
new Vue({
  el: '#app',
  render: h => h(App)
})

and this is the error im getting

Failed to compile.

/Users/temporary/node_modules/vue2-google-maps/dist/components/infoWindow.vue
Module not found: Error: Can't resolve 'babel-loader' in '/Users/temporary/node_modules/vue2-google-maps/dist/components'
 @ /Users/temporary/node_modules/vue2-google-maps/dist/components/infoWindow.vue 4:0-161 5:0-174
 @ /Users/temporary/node_modules/vue2-google-maps/dist/main.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js
David Arriaga
  • 69
  • 2
  • 11

1 Answers1

-1

Are you using vue-cli for this project? If so, you should be able to just do:

  • npm install --save-dev babel-loader

(or if you're using yarn)

  • yarn add --dev babel-loader

If you're not using vue-cli then you will still need to install babel-loader using the methods above, but you will also have to add it to your webpack config.

More on babel-loader:

Matt Oestreich
  • 8,219
  • 3
  • 16
  • 41