[TIMOB-26351] iOS CLI (Babel): Cannot read property 'isIfStatement' of null
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | None |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2018-09-05T16:42:10.000+0000 |
| Affected Version/s | Release 7.4.0, Release 7.3.0 |
| Fix Version/s | Release 7.4.0 |
| Components | CLI, iOS |
| Labels | n/a |
| Reporter | Hans Knöchel |
| Assignee | Ewan Harris |
| Created | 2018-09-02T15:03:29.000+0000 |
| Updated | 2018-09-05T18:53:39.000+0000 |
Description
When using SDK 7.4.0, the following error occurs when building kitchensink-v2 to a device
[ERROR] ~/kitchensink-v2/Resources/iphone/logger.js: Cannot read property 'isIfStatement' of null
It looks like a [known Babel issue](https://github.com/babel/minify/issues/850), but is there a way around it?
[~hknoechel] You should be able to add
--skip-js-minifyto prevent this. Is it only 7.4.0 onwards? We haven't bumped the minify version for a while AFAIKOnly noticed in 7.4.0 so far, yep. But trying it right now, it works again. But I bumped by Node version from 8 to 9 yesterday, maybe that helped.
I'm hitting this in 7.3.0 also. Looks to be because we moved from babel-preset-babili to babel-preset-minify. We can take the prerelease version of babel-preset-minify with the fix or we roll back and try and find a version without the bug. Personally I vote for the prerelease because babel-preset-minify has seemed rather unstable since we've been using it so I think we need to be proactive in testing the betas etc.
PR: https://github.com/appcelerator/node-titanium-sdk/pull/45 I went for the "safer" option of rolling back to 0.3.0 given that I think this should land in 7.4.0
Master: https://github.com/appcelerator/titanium_mobile/pull/10308 7_4_X: https://github.com/appcelerator/titanium_mobile/pull/10309
Verified the fix on 7.4.0.v20180905090826. Kitchensink app built successfully. Closing.
Operating System Name = Mac OS X Version = 10.13.6 Architecture = 64bit # CPUs = 8 Memory = 17179869184 Node.js Node.js Version = 8.9.1 npm Version = 5.5.1 Titanium CLI CLI Version = 5.1.1 Titanium SDK Sdk Version = 7.4.0.v20180905090826 Device iphone 6s with ios 10