Renaming causes bug to occur on iOS device
See original GitHub issueThe 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
.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (6 by maintainers)
Top Results From Across the Web
iPhone renaming itself | MacRumors Forums
I seem to have a strange issue where my phone keeps renaming itself. I usually keep the name of my phone the default...
Read more >iPhone 12 is constantly renaming itself - Apple Community
iPhone 12 is constantly renaming itself. Hi, I have iOS 15.4.1 and recently found when my phone pairs to my car the is...
Read more >Why does an iPhone rename itself with (2) - Ask Different
That occurs when your Wifi network, or another Wifi network he's been connected to, think that there are two devices with the same...
Read more >Xcode - renaming project causes problem - Stack Overflow
Open the Project Navigator Click on the project name at the top of the tree, tap again and rename box should appear Review...
Read more >iOS Mobile_app lost name for unknown reason - HA confused ...
As I have a LOT of automatons that now all break I tried renaming it back. I renamed the device under the “mobile...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
One more debugging item I forgot about earlier:
If you enable
options.generatePseudoNames = true
, the compiler will generate a new name that fuses the two combined variable names, instead of just using the first name. Something like:function f(a) { let b = 3; return b; }
->function f(a_b) { let a_b = 3; return a_b; }
Agreed.