Am getting the error TypeError: can't access property "falseFn", L.Util is undefined when using react-leaflet v3.2.0, NextJs v12.1.6, leaflet v1.7.1 and leaflet-draw v1.0.4. The issue is visible on Firefox browser when you run in production. The error occurs in the following code:
function cI(b, a, g, e) {
var f = a + V(g) + (e ? '_' + V(e) : '');
if (b[cF] && b[cF][f]) return this;
var d = function (a) {
return g.call(e || b, a || window.event)
},
h = d;
!c.touchNative && c.pointer && 0 === a.indexOf('touch') ? d = function (c, a, b) {
return ('touchstart' === a && (cy || (document.addEventListener(bd, cz, !0), document.addEventListener(be, cA, !0), document.addEventListener(bf, cB, !0), document.addEventListener(bg, cB, !0), cy = !0)), cw[a]) ? (b = cw[a].bind(this, b), c.addEventListener(cv[a], b, !1), b) : (console.warn('wrong event specified:', a), L.Util.falseFn)
}(b, a, d) : c.touch && 'dblclick' === a ? d = function (a, b) {
a.addEventListener('dblclick', b);
var d,
e = 0;
function c(a) {
if (1 !== a.detail) {
d = a.detail;
return
}
if ('mouse' !== a.pointerType && (!a.sourceCapabilities || a.sourceCapabilities.firesTouchEvents)) {
var c = Date.now();
c - e <= 200 ? 2 == ++d && b(function (c) {
var b,
d,
a = {
};
for (d in c) b = c[d],
a[d] = b && b.bind ? b.bind(c) : b;
return c = a,
a.type = 'dblclick',
a.detail = 2,
a.isTrusted = !1,
a._simulated = !0,
a
}(a)) : d = 1,
e = c
}
}
return a.addEventListener('click', c),
{
dblclick: b,
simDblclick: c
}
}(b, d) : 'addEventListener' in b ? 'touchstart' === a || 'touchmove' === a || 'wheel' === a || 'mousewheel' === a ? b.addEventListener(cH[a] || a, d, !!c.passiveEvents && {
passive: !1
}) : 'mouseenter' === a || 'mouseleave' === a ? (d = function (a) {
bN(b, a = a || window.event) && h(a)
}, b.addEventListener(cH[a], d, !1)) : b.addEventListener(a, h, !1) : b.attachEvent('on' + a, d),
b[cF] = b[cF] || {
},
b[cF][f] = d
}