xkjyeah / vue-google-maps

Google maps component for vue with 2-way data binding
https://xkjyeah.github.io/vue-google-maps/
1.88k stars 475 forks source link

Can't import #199

Open AndersBrohus opened 7 years ago

AndersBrohus commented 7 years ago

When i

import * as VueGoogleMaps from 'vue2-google-maps';

i got this error

These relative modules were not found:
* ./components/infoWindow.vue in ./node_modules/vue2-google-maps/dist/main.js
* ./components/map.vue in ./node_modules/vue2-google-maps/dist/main.js
* ./components/streetViewPanorama.vue in ./node_modules/vue2-google-maps/dist/main.js
* ./components/placeInput.vue in ./node_modules/vue2-google-maps/dist/main.js
* ./components/autocomplete.vue in ./node_modules/vue2-google-maps/dist/main.js
xkjyeah commented 7 years ago

What's your environment? Nuxt? Webpack? Server-side?

On Tue, Aug 29, 2017 at 5:50 PM, Anders Brohus notifications@github.com wrote:

When i

import * as VueGoogleMaps from 'vue2-google-maps';

i got this error

These relative modules were not found:

  • ./components/infoWindow.vue in ./node_modules/vue2-google-maps/dist/main.js
  • ./components/map.vue in ./node_modules/vue2-google-maps/dist/main.js
  • ./components/streetViewPanorama.vue in ./node_modules/vue2-google-maps/dist/main.js
  • ./components/placeInput.vue in ./node_modules/vue2-google-maps/dist/main.js
  • ./components/autocomplete.vue in ./node_modules/vue2-google-maps/dist/main.js

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/xkjyeah/vue-google-maps/issues/199, or mute the thread https://github.com/notifications/unsubscribe-auth/ACiTRzM9awjBCBjlT5KX0fRlLynYzyZvks5sc97ugaJpZM4PFqDe .

AndersBrohus commented 7 years ago

@xkjyeah It's Webpack :-)

xkjyeah commented 7 years ago

Yikes I'm not sure how to help you there. Must be a recent webpack or VueJs update that broke it

On 29 Aug 2017 18:40, "Anders Brohus" notifications@github.com wrote:

@xkjyeah https://github.com/xkjyeah It's Webpack :-)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/xkjyeah/vue-google-maps/issues/199#issuecomment-325625478, or mute the thread https://github.com/notifications/unsubscribe-auth/ACiTR77pi0aeMXbRe8FwMJDy9hEOvOt-ks5sc-qngaJpZM4PFqDe .

KasparTr commented 6 years ago

Same problem here with first time install. @AndersBrohus did you managed to debug this?

twetzel commented 6 years ago

same problem here!

Uncaught TypeError: Cannot read property 'install' of undefined
  at Function.Vue.use (vue.esm.js:4750)
  at Object.apply (application.js:37)
  at __webpack_require__ (bootstrap c70af23…:19)
  at Object.<anonymous> (app.vue:13)
  at __webpack_require__ (bootstrap c70af23…:19)
  at bootstrap c70af23…:62
  at bootstrap c70af23…:62

package (rails webpacker)

{
  "name": "vue-rails",
  "private": true,
  "dependencies": {
    "@rails/webpacker": "^3.3.1",
    "axios": "^0.18.0",
    "jwt-decode": "^2.2.0",
    "vue": "^2.5.16",
    "vue-axios": "^2.1.0",
    "vue-loader": "^14.2.1",
    "vue-router": "^3.0.1",
    "vue-template-compiler": "^2.5.16",
    "vue2-google-maps": "^0.8.11"
  },
  "devDependencies": {
    "webpack-dev-server": "2.11.2"
  },
  "resolve": {
    "alias": {
      "vue": "vue/dist/vue.js"
    }
  }
}
Worie commented 6 years ago

Bump! Anyone found a solution?

loursgeek commented 5 years ago

1 year after... Anyone found a solution ?

wm4tos commented 4 years ago

2 years... Some solution?

wm4tos commented 4 years ago

import { ...VueGoogleMaps } from 'vue2-google-maps';

Works for me :)

nannuflay commented 2 years ago

try this on main.js:

if (process.browser) {
  const VueGoogleMaps = require('vue2-google-maps');
  Vue.use(VueGoogleMaps, {
    load: {
      key: 'myKey',
      libraries: 'places',
    },
  });
}
fox880919 commented 2 years ago

You can try to delete node_modules folder (with all the files inside).

Then run npm install