razorness / vue-maplibre-gl

Vue 3 plugin for maplibre-gl-js
86 stars 19 forks source link

Does not work with production build #92

Open douglasg14b opened 6 months ago

douglasg14b commented 6 months ago

Production builds (ie vite build) result in numerous runtime errors like what's posted below.

    <mgl-map
        v-if="!isLoading"
        ref="map"
        :center="center"
        :zoom="zoom"
        :attribution-control="true"
        :max-bounds="bounds"
        map-style="https://api.maptiler.com/maps/streets/style.json?key=---"
        language="en"
        @map:load="onLoad"
        @map:dragend="reCalcBounds"
        @map:moveend="reCalcBounds"
        @map:zoomend="reCalcBounds"
    >
        <mgl-navigation-control />
    </mgl-map>

Unsure why, but these go away if I don't render the map. The map appears to operate normally, but the component using it is largely unusable, any state updates result in exceptions like this:

TypeError: undefined has no properties isSameVNodeType runtime-core.esm-bundler.js:7123 patchKeyedChildren runtime-core.esm-bundler.js:6294 patchChildren runtime-core.esm-bundler.js:6209 patchElement runtime-core.esm-bundler.js:5637 processElement runtime-core.esm-bundler.js:5473 patch runtime-core.esm-bundler.js:5330 componentUpdateFn runtime-core.esm-bundler.js:6098 run reactivity.esm-bundler.js:177 update runtime-core.esm-bundler.js:6142 updateComponent runtime-core.esm-bundler.js:5951 processComponent runtime-core.esm-bundler.js:5885 patch runtime-core.esm-bundler.js:5342 patchKeyedChildren runtime-core.esm-bundler.js:6295 patchChildren runtime-core.esm-bundler.js:6209 patchElement runtime-core.esm-bundler.js:5637 processElement runtime-core.esm-bundler.js:5473

TypeError: owner is undefined setRef runtime-core.esm-bundler.js:4544 patch runtime-core.esm-bundler.js:5384 componentUpdateFn runtime-core.esm-bundler.js:6098 run reactivity.esm-bundler.js:177 update runtime-core.esm-bundler.js:6142 callWithErrorHandling runtime-core.esm-bundler.js:192 flushJobs runtime-core.esm-bundler.js:399 promise callbackqueueFlush runtime-core.esm-bundler.js:308 queueJob runtime-core.esm-bundler.js:302 effect runtime-core.esm-bundler.js:6136 resetScheduling reactivity.esm-bundler.js:264 trigger reactivity.esm-bundler.js:404 set reactivity.esm-bundler.js:525 updateState index.js:118 updateState index.js:117 unsubscribe index.js:850 notify queryObserver.js:509 notify queryObserver.js:508 batch notifyManager.js:25 notify queryObserver.js:496 updateResult queryObserver.js:456 onQueryUpdate queryObserver.js:486 dispatch query.js:394 dispatch query.js:393 batch notifyManager.js:25 dispatch query.js:392 setData query.js:85 onSuccess query.js:336 resolve3 retryer.js:58 promise callbackrun3 retryer.js:116 Retryer2 retryer.js:156 fetch2 query.js:332 executeFetch queryObserver.js:199 onSubscribe queryObserver.js:40 subscribe subscribable.js:16 useBaseQuery index.js:849 useQuery index.js:882 useApi useApi.ts:30 useScreensBounds useScreensBounds.ts:6 setup ScreensMap.vue:27 callWithErrorHandling runtime-core.esm-bundler.js:192 setupStatefulComponent runtime-core.esm-bundler.js:7620 setupComponent runtime-core.esm-bundler.js:7581 mountComponent runtime-core.esm-bundler.js:5908 processComponent runtime-core.esm-bundler.js:5874 patch runtime-core.esm-bundler.js:5342 mountChildren runtime-core.esm-bundler.js:5590 processFragment runtime-core.esm-bundler.js:5804 patch runtime-core.esm-bundler.js:5316 mountChildren runtime-core.esm-bundler.js:5590 mountElement runtime-core.esm-bundler.js:5497 processElement runtime-core.esm-bundler.js:5462 patch runtime-core.esm-bundler.js:5330 componentUpdateFn runtime-core.esm-bundler.js:6018 run reactivity.esm-bundler.js:177 update runtime-core.esm-bundler.js:6142 setupRenderEffect runtime-core.esm-bundler.js:6152 mountComponent runtime-core.esm-bundler.js:5920 processComponent runtime-core.esm-bundler.js:5874