vue-google-maps icon indicating copy to clipboard operation
vue-google-maps copied to clipboard

Can't import

Open AndersBrohus opened this issue 8 years ago • 11 comments

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

AndersBrohus avatar Aug 29 '17 09:08 AndersBrohus

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

On Tue, Aug 29, 2017 at 5:50 PM, Anders Brohus [email protected] 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 .

xkjyeah avatar Aug 29 '17 10:08 xkjyeah

@xkjyeah It's Webpack :-)

AndersBrohus avatar Aug 29 '17 10:08 AndersBrohus

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" [email protected] 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 .

xkjyeah avatar Aug 29 '17 11:08 xkjyeah

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

KasparTr avatar Mar 06 '18 08:03 KasparTr

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"
    }
  }
}

twetzel avatar Apr 02 '18 09:04 twetzel

Bump! Anyone found a solution?

Worie avatar Apr 17 '18 20:04 Worie

1 year after... Anyone found a solution ?

loursgeek avatar Apr 27 '19 08:04 loursgeek

2 years... Some solution?

wm4tos avatar Jan 22 '20 20:01 wm4tos

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

Works for me :)

wm4tos avatar Jan 27 '20 18:01 wm4tos

try this on main.js:

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

nannuflay avatar Nov 30 '21 19:11 nannuflay

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

Then run npm install

fox880919 avatar Feb 04 '22 11:02 fox880919