react-leaflet-ant-path
react-leaflet-ant-path copied to clipboard
Uncaught TypeError: Cannot read property 'min' of undefined
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 (
Same Issue
And of course, me too. @scalhoun did you manage to do anything about it?
How can a package that works suddenly fail when no code changes ... is is a non-locked dependancy version that got updated?
@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]].