Closed
Description
The following JavaScript
"use strict";
const selectors_1 = require("../../../shared/selectors");
module.exports = async (dispatch, getState, { match, serverRes, appContext }) => {
const { fetchProjectDetails } = await appContext.import('../actions', __filename, __dirname);
await dispatch(fetchProjectDetails(match.params.projectHId));
if (typeof process !== 'undefined') {
if (selectors_1.getRequestErrorCode(getState(), { operationId: `/projects/${match.params.projectHId}` }) === 'NOT_FOUND') {
serverRes && serverRes.status(404);
}
}
};
Compiled like this
java -jar closure-compiler-v20181125.jar --language_in ECMASCRIPT_2017 --language_out ECMASCRIPT_2017 --js x.js --formatting PRETTY_PRINT
Results in the following code
'use strict';
const selectors_1 = require("../../../shared/selectors");
module.exports = async(d, e, {match:b, serverRes:c, appContext:a}) => {
var {fetchProjectDetails:a} = await a.import("../actions", __filename, __dirname);
await d(a(b.params.projectHId));
"undefined" !== typeof process && "NOT_FOUND" === selectors_1.getRequestErrorCode(e(), {operationId:`/projects/${b.params.projectHId}`}) && c && c.status(404);
};
This line
var {fetchProjectDetails:a} = await a.import("../actions", __filename, __dirname);
Both appContext
and fetchProjectDetails
was renamed to a
which appears to confuse iOS. The error we get is undefined is not an object (evaluating 'a.import')
. This is a consistent issue across all iOS devices we've been able to test with and I'm wondering whether there's a way to get around this issue without switching to WHITESPACE_ONLY
.