2

I'm using Nuxt.js with typescript support. I'm trying to import the vuelayers library with this plugin:

import Vue from "vue"
import Map from "vuelayers/src/component/map"
import "vuelayers/lib/style.css"

Vue.use(Map)

it gives me this error :

 ERROR  in ./node_modules/vuelayers/src/component/map/view.vue?vue&type=script&lang=js&
Syntax Error: Unexpected token, expected ";" (253:8)
  251 |    */
  252 |   subscribeAll () {
> 253 |     this::subscribeToViewChanges()
      |         ^
  254 |   },
  255 | }
  256 |

I would be happy to avoid using :: but it's in an external library. I have also tried to import different precompiled files from vuelayers/... but I always have a similar error

I'm quite new to typescript and I don't know how to proceed to fix this

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
Mathieu
  • 5,495
  • 2
  • 31
  • 48
  • Maybe try to import from `vuelayers/lib` or `vuelayers/dist` or wherever they have their transpiled js code, not their `src` folder which contains custom syntax extensions? – Bergi Aug 18 '19 at 16:48
  • already tried that @Bergi – Mathieu Aug 19 '19 at 11:42

0 Answers0