Haul: SyntaxError on iOS 9.x with React Native 44

Created on 30 May 2017  Â·  12Comments  Â·  Source: callstack/haul

We have this issue before, I need to investigate why on certain iOS versions it happens. It has something to do with Safari version and the subset of spec supported.

No issues on iOS 10.x

bug

Most helpful comment

Today is a good day! Thanks @rauliyohmc and @skellock for fixing the most annoying issue of all time! The culprit was pretty-format. Whitelisted it.

All 12 comments

Is it Symbols by any chance? I know on older version (< iOS 8.2 and Android 4.x), we need to polyfill them.

Do you have an example of the error?

If it's a missing Symbol thing, it should be easy to track down. I've used this polyfiller (usage in entry point is import 'es6-symbol/implement') which helps when 3rd party libs use Symbols. There's probably a dependency-free version of it somewhere too.

The other thing that has bitten me on older iOS devices due to strange errors is importing 3rd party libs who have their .xcodeproj targets set to higher versions of iOS.

Not naming names though.

Not sure. Even deleting entire index.ios.js (emptying it) triggers the
error, so I guess it's coming from React / React Native source file.

Will check tomorrow when testing on older devices.

If you get a chance to spin iOS 9.x in the meantime, I'd appreciate any
help! Thanks for discussing that :D

On Tue, 30 May 2017 at 20:17 Steve Kellock notifications@github.com wrote:

Do you have an example of the error?

If it's a missing Symbol thing, it should be easy to track down. I've
used this polyfiller https://github.com/medikoo/es6-symbol (usage in
entry point is import 'es6-symbol/implement') which helps when 3rd party
libs use Symbols. There's probably a dependency-free version of it
somewhere too.

The other thing that has bitten me on older iOS devices due to strange
errors is importing 3rd party libs who have their .xcodeproj targets set to
higher versions of iOS.

Not naming
https://github.com/airbnb/react-native-maps/blob/master/lib/ios/AirMaps.xcodeproj/project.pbxproj#L263
names though.

—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
https://github.com/callstack-io/haul/issues/159#issuecomment-304963602,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACWcxoWUmp3pAHyeFRRlA6r_Ya10gaLqks5r_F0ugaJpZM4Nqnzw
.

Ya, seems like it's happening a bit earlier in the chain then that.

The exact error firing on this sample project here is:

Unexpected keyword 'const'. Const declarations are not supported in strict mode.

Tested and failing on:

  • haul 0.6
  • rn 0.44.2
  • simulator: iPhone 5s @ iOS 8.2, 8.4 & 9.2

Maybe some part of babel compiling process might not be working? It looks like everything is in place. Looks like you're using the right preset (react-native).

Best part of all this: If you "Debug JS Remotely", it works. 🤣

Happening in Android simulator as well (tested with Genymotion device, Google Nexus 5)

image

Being the curlprit, pretty-format module from react-native, which is apparently the only one that keeps const declarations after transpilation:

image

I dug a bit more and that module/repository was moved into jest some time ago, so it doesn't even make sense to be bundled with either packager or haul. Packager, though, transpiles it properly. Guessing a temporary solution for Haul would be to explicitly transpile that library within webpack.haul.js config using babel loader and include option.

Today is a good day! Thanks @rauliyohmc and @skellock for fixing the most annoying issue of all time! The culprit was pretty-format. Whitelisted it.

@grabbou Can you please elaborate? Excluding pretty-format didn't solve this for me

This has been fixed few versions ago - are you running latest haul?

I kinda gave up on it since. But will try it again on my next project :)

Okies, happy to help in that case. Feel free to sign up on
slack.callstack.com for better "real-time" support ;)

On Wed, 3 Jan 2018 at 14:06 Unforgiven-wanda notifications@github.com
wrote:

I kinda gave up on it since. But will try it again on my next project :)

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/callstack/haul/issues/159#issuecomment-355007477, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACWcxmoEeQuvlz-rE8q2TPlO43f0H4_Sks5tG3s8gaJpZM4Nqnzw
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GeeWee picture GeeWee  Â·  5Comments

jurajkrivda picture jurajkrivda  Â·  4Comments

xareelee picture xareelee  Â·  5Comments

hesyifei picture hesyifei  Â·  4Comments

EamonnLaffey picture EamonnLaffey  Â·  5Comments