Skip to content

Error using ol-util in Vue3  #1226

@JakobMiksch

Description

@JakobMiksch

When I use ol-util in a vanilla Vue3 app, I get this error:

image

It seems to be a problem with the dependency shpjs and maybe also in combination with vite . I could not find a solution yet.

How to reproduce:

Create a new Vue3 app

npm create vue@latest

Select this options:

image

install dependencies

npm i
npm i ol  @terrestris/ol-util

in App.vue add this to the <script> tag:

<script setup>
import HelloWorld from './components/HelloWorld.vue'
import TheWelcome from './components/TheWelcome.vue'
import {onMounted} from 'vue'
import TileWMS from 'ol/source/TileWMS'
import { LayerUtil } from '@terrestris/ol-util'


onMounted(() => {
   const wmsSource = new TileWMS()
   const result =  LayerUtil.isOlSourceTileWMS(wmsSource)
   console.log(result)
})

</script>

then run the app:

npm run dev

then the error from above should appear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions