Minimal repro is similar to https://github.com/facebook/prepack/issues/1771 but with a few lines removed.
require("react");
__evaluatePureFunction(function() {
var fbt;
var _cachedFbtResults = {};
fbt = function fbt() {};
fbt._ = function(table, args) {
var allSubstitutions = {};
var pattern = table;
if (table.__vcg) {
args = args || [];
}
if (args) {
pattern = this._accessTable(table, allSubstitutions, args, 0);
}
var cachedFbt = _cachedFbtResults[pattern];
var hasSubstitutions;
if (cachedFbt && !hasSubstitutions) {
return cachedFbt;
} else {
var fbtContent;
var result;
if (!hasSubstitutions) {
_cachedFbtResults[pattern] = result;
}
return result;
}
};
fbt._accessTable = function(table, substitutions, args, argsIndex) {
if (argsIndex >= args.length) {
return table;
} else if (table == null) {
return null;
}
var pattern = null;
var arg = args[argsIndex];
var tableIndex = arg[0];
if (!Array.isArray(tableIndex)) {
table = tableIndex !== null ? table[tableIndex] : table;
pattern = this._accessTable(table, substitutions, args, argsIndex + 1);
}
return pattern;
};
function _getNumberVariations(number) {
var numberType;
return [numberType, "*"];
}
fbt._param = fbt.param = function(label, value, variations) {
return [null, {}];
};
fbt._plural = fbt.plural = function(count, label, value) {
var variation = _getNumberVariations(count);
return [variation, []];
};
var React = require("react");
function ViewCount(props) {
return React.createElement(
"div",
fbt._({ "*": "{count} Views", _1: "{count} View" }, [
fbt._param("count", props.feedback.viewCountReduced),
fbt._plural(props.feedback.viewCount)
])
);
}
__optimizeReactComponentTree(ViewCount);
module.exports = ViewCount;
});
We hit this invariant:
The invariant failure is a way of saying: the serializer tried to serialize a value that wasn't visited.
Here's a much smaller repro for the same invariant violation; might or might not be the same root cause:
(function () {
let outer = {};
function f(x) {
outer.x = x;
}
__optimize(f);
global.f = f;
inspect = function() { return true; }
})();
This isn't fixed yet. Still fails for me.
The repro case in the post compiles for me.

My bad I hadn鈥檛 rebased