react-leaflet-ant-path icon indicating copy to clipboard operation
react-leaflet-ant-path copied to clipboard

Uncaught TypeError: Cannot read property 'min' of undefined

Open mojabyte opened this issue 5 years ago • 4 comments

leaflet = v1.6.0 react = v16.12.0 react-leaflet = v2.6.1 leaflet-ant-path = v1.3.0

Uncaught TypeError: Cannot read property 'min' of undefined at NewClass._updateBounds (leaflet-src.js:8338) at NewClass.setStyle (leaflet-src.js:7881) at e.value (leaflet-ant-path.js:1) at t.value (react-leaflet-ant-path.js:1) at t.componentDidUpdate (MapLayer.js:45) at t.componentDidUpdate (Path.js:40) at commitLifeCycles (react-dom.development.js:22117) at commitLayoutEffects (react-dom.development.js:25344) at HTMLUnknownElement.callCallback (react-dom.development.js:336) at Object.invokeGuardedCallbackDev (react-dom.development.js:385) at invokeGuardedCallback (react-dom.development.js:440) at commitRootImpl (react-dom.development.js:25082) at unstable_runWithPriority (scheduler.development.js:697) at runWithPriority$2 (react-dom.development.js:12149) at commitRoot (react-dom.development.js:24922) at finishSyncRender (react-dom.development.js:24329) at performSyncWorkOnRoot (react-dom.development.js:24307) at react-dom.development.js:12199 at unstable_runWithPriority (scheduler.development.js:697) at runWithPriority$2 (react-dom.development.js:12149) at flushSyncCallbackQueueImpl (react-dom.development.js:12194) at flushSyncCallbackQueue (react-dom.development.js:12182) at batchedUpdates$1 (react-dom.development.js:24392) at Object.notify (Subscription.js:23) at Subscription.notifyNestedSubs (Subscription.js:65) at Subscription.handleChangeWrapper (Subscription.js:70) at Object.dispatch (redux.js:222) at e (:1:40553) at redux-saga-core.esm.js:1410 at index.js:11 at dispatch (redux.js:638) at io-6de156f3.js:133 at redux-saga-core.esm.js:472 at exec (redux-saga-core.esm.js:31) at flush (redux-saga-core.esm.js:87) at asap (redux-saga-core.esm.js:46) at runPutEffect (redux-saga-core.esm.js:468) at runEffect (redux-saga-core.esm.js:1204) at digestEffect (redux-saga-core.esm.js:1271) at next (redux-saga-core.esm.js:1161) at currCb (redux-saga-core.esm.js:1251)

mojabyte avatar Feb 19 '20 09:02 mojabyte

Same Issue

scalhoun avatar Apr 01 '20 18:04 scalhoun

And of course, me too. @scalhoun did you manage to do anything about it?

paulincai avatar Apr 09 '20 07:04 paulincai

How can a package that works suddenly fail when no code changes ... is is a non-locked dependancy version that got updated?

b-nik avatar Apr 26 '20 11:04 b-nik

@HassanMojab @scalhoun @paulincai I finally found time to dig into the stack trace of the error and find the culprit. This was probably not required before until some package got updated, but as of now, you MUST pass at least 1 point in the AntPath, or it will crash.

To be more clear you probably have something like

<AntPath positions={this.getLatLngs()} />

You need to make sure that getLatLngs() will never return an empty array []. If you have no data, just don't render the AntPath component at all, or return a single point i.e. [[0, 0]].

b-nik avatar May 06 '20 00:05 b-nik