xkjyeah / vue-google-maps

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

ERROR in app.605102892b600e307771.js from UglifyJs #268

Open miljko1984 opened 6 years ago

miljko1984 commented 6 years ago

Hi, I'am using Nuxt.js with your plugin. All is working nice, but when i try to do npm run build i got this error:

Unexpected token: punc (() [./node_modules/vue2-google-maps/src/components/polygon.js:50,0][app.605102892b600e307771.js:467,8]

Thanks in advance.

ggirodda commented 6 years ago

I have the same problem, I'm using nuxt too: Unexpected token: punc (() [./node_modules/vue2-google-maps/src/components/polyg on.js:50,0]

ggirodda commented 6 years ago

I see that there is maybe a fix here: https://github.com/xkjyeah/vue-google-maps/pull/235

ggirodda commented 6 years ago

This solution worked for me: https://github.com/xkjyeah/vue-google-maps/issues/217#issuecomment-335912985

miljko1984 commented 6 years ago

This solution worked for me: nuxt.config.js file

build: { extend (config, ctx) { config.module.rules.splice(0, 0, { test: /.js$/, include: [path.resolve(__dirname, './node_modules/vue2-google-maps')], loader: 'babel-loader', }) } }

And in top of file, before module.exports = { add - const path = require('path')

rmNyro commented 6 years ago

I had the same problem, I fixed it the same way mijiko did using the owner's solution https://github.com/xkjyeah/vue-google-maps/issues/206#issuecomment-338689932.

TynesideGroup commented 6 years ago

The solution works for me when running in dev, but the issue persists when attempting to build for production.

TynesideGroup commented 6 years ago

I have resolved my issue with the production build. I was using ./node_modules when I should have been using ../node_modules in my particular case as some of my directories and configuration is set up slightly different to standard.

ggirodda commented 6 years ago

I fixed with this solution too https://github.com/xkjyeah/vue-google-maps/issues/206#issuecomment-338689932