Looks like an unknown-but-fixed bug somewhere in [email protected] to [email protected].
@esutton noted a likely workaround
of adding a resolution to more modern uglify in package.json of:
"resolutions": {
"uglify-es": "3.3.4"
}
I'm going to close #197 as a duplicate and we'll track everything further here.
Hi,
I'm really sorry to open a bug without specific details.
I'm using the latest version of the library
"victory-native": "^0.16.1"
"react-native-svg": "react-native-svg@^6.0.0",
And trying to use a candlestick chart.
The library works correctly in the simulator and with the attached device, but when deployed to the store (beta release) it crash on google pixel (so 8.0).
I tried on a nexus 5 with no issue.
I have no idea how to debug any further or what to try, I'm not an Android developer so there might be an easy way to do so I'm not aware about.
Any suggestion?
Found the log from google play
Report 1
com.facebook.react.common.JavascriptException: ReferenceError: Can't find variable: a45937
This error is located at:
in VictoryChart
in RCTView
in RCTView
in RCTView
in RCTView
in RCTModalHostView
in t
in t
in RCTView
in t
in Connect(t)
in t
in RCTView
in n
in t
in n
in RCTView
in RCTView
in t
in RCTView
in n
in r
in Unknown
in t
in a
in Unknown
in Connect(Component)
in RCTView
in t
in Connect(t)
in n
in t
in RCTView
in RCTView
in t, stack:
padDomain@820:4635
getDomain@950:1171
getDomain@949:1526
value@942:2767
value@942:4899
l@41:35689
beginWork@41:37385
u@41:51312
f@41:51928
p@41:53002
batchedUpdates@41:58674
a@41:603
batchedUpdates@41:21879
_receiveRootNodeIDEvent@41:70324
receiveTouches@41:70936
value@18:3177
value@18:2606
value@18:883
at com.facebook.react.modules.core.ExceptionsManagerModule.showOrThrowError(ExceptionsManagerModule.java
at com.facebook.react.modules.core.ExceptionsManagerModule.reportFatalException (ExceptionsManagerModule.java:40)
at java.lang.reflect.Method.invoke (Native Method)
at com.facebook.react.bridge.JavaMethodWrapper.invoke (JavaMethodWrapper.java:374)
at com.facebook.react.bridge.JavaModuleWrapper.invoke (JavaModuleWrapper.java:162)
at com.facebook.react.bridge.queue.NativeRunnable.run (Native Method)
at android.os.Handler.handleCallback (Handler.java:789)
at android.os.Handler.dispatchMessage (Handler.java:98)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage (MessageQueueThreadHandler.java:31)
at android.os.Looper.loop (Looper.java:164)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$3.run (MessageQueueThreadImpl.java:194)
at java.lang.Thread.run (Thread.java:764)
Same Here
React native 0.50 only on live devices and not simulators
ReferenceError: Can't find variable: a81197
This error is located at:
in VictoryChart
in RNSVGSvgView
in Svg
in RCTView
in t
in RCTView
in t
in RCTView
in RCTView
in RCTScrollView
in ScrollView
in RCTView
in t
in t
in RCTView
in Unknown
in AndroidViewPager
in n
in n
in RCTView
in ScrollableTabView
in RCTView
in t
in RCTView
in t
in RCTView
in RCTView
in t
in Connect(t)
in RCTView
in t
in r
in RCTView
in n
in r
in n
in n
in RCTView
in RCTView
in t
in n
in t
in e
in RCTView
in RCTView
in t
in RCTView
in t
in RCTView
in t
in r
in RCTView
in n
in r
in n
in n
in RCTView
in RCTView
in t
in n
in t
in e
in r
in t
in Provider
in RCTView
in r
in RCTView
in RCTView
in t
works on react-native 49, broken on 50 and 51
IOs crash also on simulator
2017-12-10 12:30:16.756761+0000 CryptoViewer[35996:4093596] * Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: ReferenceError: Can't find variable: a40691
This error is located at:
in VictoryChart
in RCTView
in RCTView
in RCTView
in RCTView
in RCTModalHostView
in t
in t
in RCTView
in t
in Connect(t)
in t
in RCTView
in n
in t
in n
in RCTView
in RCTView
in t
in RCTView
in n
in r
in Unknown
in t
in a
in Unknown
in Connect(Component)
in RCTView
in t
in Connect(t)
in n
in t
in RCTView
in RCTView
in t', reason: 'Unhandled JS Exception: ReferenceError: Can't find variable: a40691
This e..., stack:
padDomain@823:4635
getDomain@953:1171
getDomain@952:1526
value@945:2294
value@945:4426
l@46:35668
u@46:51291
f@46:51907
p@46:52981
batchedUpdates@46:58653
batchedUpdates@46:21858
_receiveRootNodeIDEvent@46:70303
receiveTouches@46:70915
value@18:3078
value@18:2507
value@18:784
'
* First throw call stack:
(
0 CoreFoundation 0x00000001036a61ab __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000102009f41 objc_exception_throw + 48
2 CoreFoundation 0x000000010371acb5 +[NSException raise:format:] + 197
3 CryptoViewer 0x0000000101317ad7 RCTFatal + 393
4 CryptoViewer 0x00000001013148d4 -[RCTExceptionsManager reportFatalException:stack:exceptionId:] + 507
5 CoreFoundation 0x000000010362a49c __invoking___ + 140
6 CoreFoundation 0x000000010362a370 -[NSInvocation invoke] + 320
7 CoreFoundation 0x0000000103642d56 -[NSInvocation invokeWithTarget:] + 54
8 CryptoViewer 0x0000000101328551 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 602
9 CryptoViewer 0x0000000101369bbd _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicE + 269
10 CryptoViewer 0x0000000101369934 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 78
11 libdispatch.dylib 0x00000001085103f7 _dispatch_call_block_and_release + 12
12 libdispatch.dylib 0x000000010851143c _dispatch_client_callout + 8
13 libdispatch.dylib 0x000000010851995b _dispatch_queue_serial_drain + 1162
14 libdispatch.dylib 0x000000010851a2df _dispatch_queue_invoke + 336
15 libdispatch.dylib 0x000000010851607d _dispatch_queue_override_invoke + 733
16 libdispatch.dylib 0x000000010851d1f9 _dispatch_root_queue_drain + 772
17 libdispatch.dylib 0x000000010851ce97 _dispatch_worker_thread3 + 132
18 libsystem_pthread.dylib 0x00000001089d91ca _pthread_wqthread + 1387
19 libsystem_pthread.dylib 0x00000001089d8c4d start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException
This appears to be a problem caused by minification, but I've not been able to track down the underlying cause.
Duplicate of #197 (?)
It seems using the latest version of react and victory the problem isn't there anymore
@obsidianart
Doesnt work for me with RN 0.51.0
What versions do you use?
Can you also tell me what victory version and svg?
"react-native": "0.51.0"
"react-native-svg": "6.0.1-rc.1"
"victory-native": "0.16.5"
Unfortunately Still crashing for me (when minified on release) with all libraries updated.
"react-native": "0.51.0"
"react-native-svg": "6.0.1-rc.1"
"victory-native": "0.16.5"
ReferenceError: ReferenceError: Can't find variable: a55973
This error is located at:
in VictoryChart
in RCTView
in t
in RCTView
in RCTView
in RCTView
in n
in RCTView
in RCTView
in RCTView
in RCTModalHostView
in t
in ModalBox
in RCTView
in t
in RCTView
in e
in Connect(e)
in t
in RCTView
in Unknown
in AndroidViewPager
in n
in n
in RCTView
in ScrollableTabView
in RCTView
in RCTView
in t
in Connect(t)
in RCTView
in t
in r
in RCTView
in n
in r
in n
in n
in RCTView
in RCTView
in t
in n
in t
in e
in RCTView
in RCTView
in t
in RCTView
in t
in RCTView
in t
in r
in RCTView
in n
in r
in n
in n
in RCTView
in RCTView
in t
in n
in t
in e
in r
in t
in Provider
in RCTView
in r
in RCTView
in RCTView
in t
at victory-core/lib/victory-util/domain.padDomain(domain.js:371)
min: domainMin >= 0 && domainMin - initialPadding.left <= 0 ? 0 : domainMin.valueOf() - initialPadding.left,
at victory-core/lib/victory-util/domain.getDomain(domain.js:52)
return this.padDomain(propsDomain, props, axis);
at victory-chart/src/helpers/wrapper.getDomainFromChildren(wrapper.js:154)
const childDomain = child.props && child.type.getDomain(sharedProps, currentAxis);
at victory-chart/src/helpers/wrapper.getDomain(wrapper.js:46)
const childDomain = this.getDomainFromChildren(props, axis, childComponents);
at victory-chart/src/components/victory-chart/helper-methods.default(helper-methods.js:67)
const domain = Wrapper.getDomain(props, axis, childComponents);
...
(17 additional frame(s) were not displayed)
Same ask as on #197 -- can anyone experiencing this minification issue please get us either:
I tried to make a clean version of RN and just this plugin and SVG as @ryan-roemer suggested but everything worked fine, so for a new project it runs with no problems.
For me, on an existing project (50+ plugins and other libraries) it still crashes.
I updated svg, victory and others, deleted them all and reinstalling them.
I don't know what more to do.
some more errors that i got:
ReferenceErrorgetAxisOffset(victory-chart/src/components/victory-chart/helper-methods)
ReferenceErrorgetAxisOffset(validator/lib/unescape)
@zivchen -- What does your configuration / imports of victory* look like? I'm curious because I see victory-chart/src in your comment above and previous stack trace and I think everything needs to come from a victory-*/lib directory (already built).
@ryan-roemer -- i do regular import as instructed, import { * } from "victory-native";
I have this "sentry.io" JS crash catcher so that's the input from him
Hmmm... it's going to be tough going for us to diagnose without a reproduction that we can play with, especially given that your latest example:
ReferenceErrorgetAxisOffset(victory-chart/src/components/victory-chart/helper-methods)
shouldn't even possibly be an error because the import path can never normally include victory-chart/src...
@ryan-roemer - see https://github.com/FormidableLabs/victory-native/blob/ebaa0ff498bd5ede2c2edde0054f59ab4a1ed831/lib/components/victory-chart.js#L4.
VictoryChart is being imported from victory-chart/src and React Native is dutifully trying to both transform and minify that file (and its dependencies).
Thanks @trabianmatt !
@boygirl @carlospaelinck @kenwheeler -- Anyone know why we're importing from victory-*/src/ instead of victory-*/ directly (impliedly victory-*/(lib|es)/?
Also @trabianmatt -- can you get me a snippet of the minified code with the function surrounding the originating exception? Without this, we're purely guessing at solutions -- aka, the victory-*/src import wasn't intended by us and we're looking to patch that, but there's no guarantee it's in any way connected to this issue... Thanks!
Is there any work around for this?
@kylesziv -- Are you hitting the error? If so, like I've been asking for everyone else can you get me a snippet of the minified code with the function surrounding the originating exception?
For everyone else here, we're unlikely going to make progress on the issue without at least a starting point of the minified victory-native function code at issue being reported to us...
Also, for everyone else hitting the error on [email protected], can folks try an update to [email protected] and report back if that makes any difference.
Thanks!
I'm not really sure if this helps but this is the minified code that I fetched from my production build. Based on viewing the methods in this dump, it appears that the issue is in the VictoryCharts library... so it seems the two aren't playing together nicely.
The error from receiving is:
ReferenceError: ReferenceError: Can't find variable: a26150
You can see that it is the padDomain method contains a call to a26150. For more information, this is using 0.16.6 of victory-native.
It looks like the padDomain method comes from here:
https://github.com/FormidableLabs/victory-core/blob/af6c2d7f8ebf05301423b24a306961469bcf0417/src/victory-util/domain.js#L338
__d(function(t, a, e, n) {
function r(t) {
return t && t.__esModule ? t : {
default: t
}
}
function i(t) {
if (Array.isArray(t)) {
for (var a = 0, e = Array(t.length); a < t.length; a++) e[a] = t[a];
return e
}
return Array.from(t)
}
Object.defineProperty(n, "__esModule", {
value: !0
});
var u = r(a(986)),
o = r(a(598)),
f = r(a(974)),
l = r(a(600)),
m = r(a(1052)),
g = r(a(1053)),
d = r(a(1020)),
c = r(a(1019));
n.default = {
getDomain: function(t, a) {
var e = this.getDomainFromProps(t, a);
if (e) return this.padDomain(e, t, a);
var n = this.getDomainFromCategories(t, a);
if (n) return this.padDomain(n, t, a);
var r = m.default.getData(t),
i = this.getDomainFromData(t, a, r);
return this.cleanDomain(this.padDomain(i, t, a), t, a)
},
cleanDomain: function(t, a, e) {
if ("log" !== g.default.getScaleType(a, e)) return t;
return (function(t) {
var a = t[0] < 0 || t[1] < 0 ? -1 / Number.MAX_SAFE_INTEGER : 1 / Number.MAX_SAFE_INTEGER;
return [0 === t[0] ? a : t[0], 0 === t[1] ? a : t[1]]
})(t)
},
getDomainWithZero: function(t, a) {
var e = this.getDomainFromProps(t, a);
if (e) return this.cleanDomain(this.padDomain(e, t, a), t, a);
var n = t.horizontal,
r = function(t, e) {
var r = d.default.getCurrentAxis(a, n);
if ("x" === r) return t;
if (!e) return [c.default.getMinValue(t, 0), c.default.getMaxValue(t, 0)];
var u = (0, l.default)(e),
o = u.map(function(t) {
return t["_" + r + "0"] || 0
}),
f = u.map(function(t) {
return t["_" + r + "1"] || t["_" + r] || 0
});
return [c.default.getMinValue([].concat(i(t), i(o), i(f))), c.default.getMaxValue([].concat(i(t), i(f), i(o)))]
},
u = this.getDomainFromCategories(t, a);
if (u) return this.cleanDomain(this.padDomain(r(u), t, a), t, a);
var o = m.default.getData(t),
f = r(this.getDomainFromData(t, a, o), o);
return this.cleanDomain(this.padDomain(f, t, a), t, a)
},
getDomainFromProps: function(t, a) {
return t.domain && t.domain[a] ? t.domain[a] : t.domain && Array.isArray(t.domain) ? t.domain : void 0
},
getDomainFromData: function(t, a, e) {
var n = d.default.getCurrentAxis(a, t.horizontal),
r = (0, l.default)(e),
i = r.map(function(t) {
return void 0 === t["_" + n + "1"] ? t["_" + n] : t["_" + n + "1"]
}),
u = r.map(function(t) {
return void 0 === t["_" + n + "0"] ? t["_" + n] : t["_" + n + "0"]
});
if (i.length < 1) return g.default.getBaseScale(t, a).domain();
var o = c.default.getMinValue(u),
f = c.default.getMaxValue(i),
m = void 0;
m = +o == +f ? this.getSinglePointDomain(f) : [o, f];
var s = Math.abs((t.startAngle || 0) - (t.endAngle || 360));
return t.polar && "x" === a && 360 === s ? this.getSymmetricDomain(m, i) : m
},
getSinglePointDomain: function(t) {
var a = Math.pow(10, -10);
return [t instanceof Date ? new Date(+t - 1) : t - a, t instanceof Date ? new Date(+t + 1) : t + a]
},
getSymmetricDomain: function(t, a) {
var e = (0, u.default)(a.sort(function(t, a) {
return t - a
})),
n = e[1] - e[0];
return [t[0], t[1] + n]
},
getDomainFromTickValues: function(t, a) {
var e = void 0;
if (d.default.stringTicks(t)) e = [1, t.tickValues.length];
else {
var n = t.tickValues.map(function(t) {
return +t
}),
r = [c.default.getMinValue(n), c.default.getMaxValue(n)];
e = t.polar && "x" === a ? this.getSymmetricDomain(r, n) : r
}
return d.default.isVertical(t) && e.reverse(), e
},
getDomainFromCategories: function(t, a) {
var e = m.default.getCategories(t, a);
if (e) {
var n = c.default.containsStrings(e) ? m.default.getStringsFromCategories(t, a) : [],
r = 0 === n.length ? null : n.reduce(function(t, a, e) {
return t[a] = e + 1, t
}, {}),
i = r ? e.map(function(t) {
return r[t]
}) : e;
return [c.default.getMinValue(i), c.default.getMaxValue(i)]
}
},
getDomainFromGroupedData: function(t, a, e) {
var n = t.horizontal,
r = "x" === a && !n || "y" === a && n;
if (r && t.categories) return this.getDomainFromCategories(t, a);
var u = this.getDomainFromData(t, a, e),
o = r ? [] : this.getCumulativeData(t, a, e),
f = o.map(function(t) {
return t.reduce(function(t, a) {
return a > 0 ? +a + +t : t
}, 0)
}),
l = o.map(function(t) {
return t.reduce(function(t, a) {
return a < 0 ? +a + +t : t
}, 0)
}),
m = Math.min.apply(Math, i(l)),
g = m < 0 ? m : c.default.getMinValue(u),
d = c.default.getMaxValue.apply(c.default, [u].concat(i(f)));
return +g == +d ? this.getSinglePointDomain(g) : [g, d]
},
getCumulativeData: function(t, a, e) {
var n = d.default.getCurrentAxis(a, t.horizontal),
r = "x" === n ? "y" : "x",
i = [],
u = [];
e.forEach(function(t) {
t.forEach(function(t) {
void 0 === t.category || (0, f.default)(i, t.category) ? (0, f.default)(u, t["_" + r]) || u.push(t["_" + r]) : i.push(t.category)
})
});
return 0 === i.length ? u.map(function(t, a) {
return e.map(function(t) {
return t[a] && t[a]["_" + n]
})
}) : i.map(function(t) {
return e.reduce(function(e, n) {
return n.category === t ? e.concat(n["_" + a]) : e
}, [])
})
},
getDomainPadding: function(t, a) {
var e = function(t) {
return Array.isArray(t) ? {
left: t[0],
right: t[1]
} : {
left: t,
right: t
}
};
return e((0, o.default)(t.domainPadding) ? t.domainPadding[a] : t.domainPadding)
},
padDomain: function(t, a, e) {
if (!a.domainPadding) return t;
var n = this.getDomainPadding(a, e);
if (!n.left && !n.right) return t;
var r = c.default.getMinValue(t),
u = c.default.getMaxValue(t),
o = d.default.getRange(a, e),
f = Math.abs(Math.max.apply(Math, i(o)) - Math.min.apply(Math, i(o))),
l = (Math.abs(u - r), n.left, Math.abs(u - r), n.right, r >= 0 && r - a26150.left <= 0 || r.valueOf(), u <= 0 && u + a26150.right >= 0 || u.valueOf(), Math.abs(a26151.max - a26151.min) * n.left / f),
m = Math.abs(a26151.max - a26151.min) * n.right / f,
g = {
min: r >= 0 && r - l <= 0 ? 0 : r.valueOf() - l,
max: u >= 0 && u + m <= 0 ? 0 : u.valueOf() + m
};
return r instanceof Date || u instanceof Date ? [new Date(g.min), new Date(g.max)] : [g.min, g.max]
}
}
}, 1056);
That鈥檚 similar to what I saw.
@kylesziv -- Interesting! Can you check if there are any variables "nearby" a26150 like a26151 referenced there, or really anything matching the regex of say a261[0-9]{2} or something like that?
Unfortunately, the only variables that match that regex are in that same padDomain method.
@kylesziv -- Thanks for all the work! Any chance you can create a minimal repository that reproduces this error with install + build steps so that we can build and see the error on our machines? (any recent version of victory-native is fine to use.
My hunch is that I mentioned in the other ticket (https://github.com/FormidableLabs/victory-native/issues/197#issuecomment-353369316) is that the underlying bug may go away if we refactor the pattern:
const coolName = {
x,
y
};
to:
const coolNameX;
const coolNameY;
But, I'd love to be able to experience this issue first hand to fully decompile an entire production bundle.
I've managed to let victory-native run, here's what I do:
1. turn off the minify mangle by change
node_modules/metro-bundler/src/JSTransformer/worker/minify.js
mangle: { toplevel: true } to mangle: false
2. run your code in XCode and the error report will give you the name of the variable that missing.
3. find the variable in victory-native source code and replicate the variable just below it's definition like below:
`node_modules/victory-chart/src/components/victory-chart/helper-methods.js
// eslint-disable-next-line complexity
getAxisOffset(props, calculatedProps) {
const { axisComponents, scale, origin, domain, originSign, padding } = calculatedProps;
const { top, bottom, left, right } = padding;
// make the axes line up, and cross when appropriate
const axisOrientations = {
x: Axis.getOrientation(axisComponents.x, "x", originSign.y),
y: Axis.getOrientation(axisComponents.y, "y", originSign.x)
};
axisOrientations;
const orientationOffset = {
y: axisOrientations.x === "bottom" ? bottom : top,
x: axisOrientations.y === "left" ? left : right
};
orientationOffset;
const originOffset = {
x: axisOrientations.y === "left" ? 0 : props.width,
y: axisOrientations.x === "bottom" ? props.height : 0
};
const originPosition = {
x: origin.x === domain.x[0] || origin.x === domain.x[1] ? 0 : scale.x(origin.x),
y: origin.y === domain.y[0] || origin.y === domain.y[1] ? 0 : scale.y(origin.y)
};
originPosition;
const calculatedOffset = {
x: originPosition.x ? Math.abs(originOffset.x - originPosition.x) : orientationOffset.x,
y: originPosition.y ? Math.abs(originOffset.y - originPosition.y) : orientationOffset.y
};
calculatedOffset;
return {
x: axisComponents.x && axisComponents.x.offsetX !== undefined ?
axisComponents.x.offsetX : calculatedOffset.x,
y: axisComponents.y && axisComponents.y.offsetY !== undefined ?
axisComponents.y.offsetY : calculatedOffset.y
};
},
node_modules/victory-core/src/victory-util/domain.js
/**
domainPadding prop appliedvar padding = this.getDomainPadding(props, axis);
if (!padding.left && !padding.right) {
return domain;
}
var domainMin = Collection.getMinValue(domain);
var domainMax = Collection.getMaxValue(domain);
var range = Helpers.getRange(props, axis);
var rangeExtent = Math.abs(Math.max.apply(Math, _toConsumableArray(range)) - Math.min.apply(Math, _toConsumableArray(range)));
// Naive initial padding calculation
var initialPadding = {
left: Math.abs(domainMax - domainMin) * padding.left / rangeExtent,
right: Math.abs(domainMax - domainMin) * padding.right / rangeExtent
};
**initialPadding;**
// Adjust the domain by the initial padding
var adjustedDomain = {
min: domainMin >= 0 && domainMin - initialPadding.left <= 0 ? 0 : domainMin.valueOf() - initialPadding.left,
max: domainMax <= 0 && domainMax + initialPadding.right >= 0 ? 0 : domainMax.valueOf() + initialPadding.right
};
**adjustedDomain;**
// re-calculate padding, taking the adjusted domain into account
var finalPadding = {
left: Math.abs(adjustedDomain.max - adjustedDomain.min) * padding.left / rangeExtent,
right: Math.abs(adjustedDomain.max - adjustedDomain.min) * padding.right / rangeExtent
};
**finalPadding;**
// Adjust the domain by the final padding
var finalDomain = {
min: domainMin >= 0 && domainMin - finalPadding.left <= 0 ? 0 : domainMin.valueOf() - finalPadding.left,
max: domainMax >= 0 && domainMax + finalPadding.right <= 0 ? 0 : domainMax.valueOf() + finalPadding.right
};
**finalDomain;**
return domainMin instanceof Date || domainMax instanceof Date ? [new Date(finalDomain.min), new Date(finalDomain.max)] : [finalDomain.min, finalDomain.max];
}
`
4. repeat step 3 until there's no variable missing.
This is still just a ugly hacking workaround.
I'm still hoping a real bug fix. :)
@jswxwxf -- What version of metro-bundler are you using? I've been looking in to https://github.com/facebook/metro and they've had a lot of churn recently in versions and packages of Uglify that they're using...
We might be encountering an upstream uglify-js or uglify-es bug (different versions of metro bundler use different ones...)
I don't know, I just use the metro-bundler that comes with react-native 0.50.3
Ok, I've take a look inside node_modules folder and the version is 0.20.3.
@jswxwxf -- Can you run:
$ cat node_modules/metro-bundler/package.json | grep version
?
Ok, I've take a look inside node_modules folder and the version is 0.20.3.
OK. For note-taking, I think we're looking at:
which have:
"uglify-es": "^3.1.8",
which is behind harmony (the long-lived equivalent of uglify-es@master branch) as follows: https://github.com/mishoo/UglifyJS2/compare/v3.1.8...harmony
Might be worth looking into closed bugs between [email protected] to [email protected]
@jswxwxf / everyone else -- Can some see if uglify-es is located in:
node_modules/metro-bundler/node_modules/uglify-esnode_modules/uglify-es if notthen note the specific version...
then upgrade it to [email protected] and let us know if that has any impact on the minification issue?
Thanks!
I expect apps using victory-native are one of many apps that have suddenly started crashing in release builds due to minification.
React native is crashing here:
https://github.com/facebook/react-native/blob/33d710e8c58ef1dc69816a59ac1cf390894e7cb9/Libraries/Components/Subscribable.js#L33
File: react-native/Libraries/Components/Subscribable.js
componentWillUnmount: function() {
this._subscribableSubscriptions.forEach( // <- Crash here when using a ScrollView
(subscription) => subscription.remove()
);
this._subscribableSubscriptions = null;
},
It is disturbing how fragile JS frameworks are. I expect * many * apps are breaking randomly because of this.
This work-around succeeded for an issue that may be related to this #199 issue.
1) Add, then commit the following uglify-es 3.3.4 resolution to your Awesome project's package.json:
"dependencies": {
...
"react": "^16.2.0",
"react-native": "^0.51.0",
...
},
"resolutions": {
"uglify-es": "3.3.4"
}
Build and run:
````
git clone https://acme.com/Awesome source
cd source
yarn
react-native run-android --variant=release
react-native run-ios
```
This worked for me. Built and pushed to production just fine.
@kylesziv Which solution worked for you?
@esutton Sorry for not being more specific. It is the one you suggested.
Most helpful comment
I expect apps using victory-native are one of many apps that have suddenly started crashing in release builds due to minification.
React native is crashing here:
https://github.com/facebook/react-native/blob/33d710e8c58ef1dc69816a59ac1cf390894e7cb9/Libraries/Components/Subscribable.js#L33
See: Unhandled JS Exception: TypeError: undefined is not an object (evaluating 'this._subscribableSubscriptions.forEach')
It is disturbing how fragile JS frameworks are. I expect * many * apps are breaking randomly because of this.
Work-Around:
This work-around succeeded for an issue that may be related to this #199 issue.
1) Add, then commit the following uglify-es 3.3.4 resolution to your Awesome project's package.json:
Build and run:
````
git clone https://acme.com/Awesome source
cd source
yarn
react-native run-android --variant=release
Use Xcode to verify Scheme is set to release
react-native run-ios
```