question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

Changes in iOS 12.3 may break builds

See original GitHub issue

Description

(please donā€™t kill me for not following the template šŸ˜„- this is more of a ā€œheads upā€ than a bug report)

In iOS 12.3, it looks like Apple is introducing a new type called symbol to the JavaScriptCore API: (from /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/JavaScriptCore.framework/Headers/JSValueRef.h)

/*!
@enum JSType
@abstract     A constant identifying the type of a JSValue.
@constant     kJSTypeUndefined  The unique undefined value.
@constant     kJSTypeNull       The unique null value.
@constant     kJSTypeBoolean    A primitive boolean value, one of true or false.
@constant     kJSTypeNumber     A primitive number value.
@constant     kJSTypeString     A primitive string value.
@constant     kJSTypeObject     An object value (meaning that this JSValueRef is a JSObjectRef).
@constant     kJSTypeSymbol     A primitive symbol value.
*/
typedef enum {
    kJSTypeUndefined,
    kJSTypeNull,
    kJSTypeBoolean,
    kJSTypeNumber,
    kJSTypeString,
    kJSTypeObject,
    kJSTypeSymbol API_AVAILABLE(macosx(10.14.4), ios(12.3))
} JSType;

This has certain consequences for Realm: https://github.com/realm/realm-js/blob/91d87fe0a94ae3101b6bb57f33c8d64ed96465d6/src/jsc/jsc_value.hpp#L44-L54

Since the kJSTypeSymbol enum value is not handled in the above switch statement, builds on Xcode 10.2 Beta (10P82s) will fail with this error: image

I was able to resolve the error by adding this:

case kJSTypeSymbol: return "symbol";

Iā€™m not sure what side effects that change has so I havenā€™t made a PR yet.

Version of Realm and Tooling

  • Realm JS SDK Version: 2.21.1
  • Node or React Native: React Native
  • Client OS & Version: Building for iOS 12.2 (so Iā€™m not sure why this issue is occuring with API_AVAILABLE(macosx(10.14.4), ios(12.3)))
  • Which debugger for React Native: None

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
shivkrishnashahcommented, May 9, 2019

Fixed By Adding

case kJSTypeSymbol: return ā€œsymbolā€;

Example

switch (JSValueGetType(ctx, value)) {
    case kJSTypeNull: return "null";
    case kJSTypeNumber: return "number";
    case kJSTypeObject: return "object";
    case kJSTypeString: return "string";
    case kJSTypeBoolean: return "boolean";
    case kJSTypeUndefined: return "undefined";
    case kJSTypeSymbol: return "symbol";
}
5reactions
knethcommented, Feb 7, 2019

@rajivshah3 Thanks for the update. We are in the process of updating and preparing our CI system with the latest Apple releases (still waiting for next Xcode version).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Apple releases updates for iOS 12.3 with TV app additions
The beta for iOS largely featured major changes relating to the TV app, namely preparing the operating systems for the public launch of...
Read more >
macOS Monterey 12.3 Release Notes - Apple Developer
macOS Monterey 12.3 Release Notes. Update your apps to use new features, and test your apps against API changes. Overview.
Read more >
Apple releases iOS 12.3.1 and a supplemental update for ...
The iOS update primarily focused on fixing some issues with the Messages app. More specifically, it addresses a bug that prevented the "reportĀ ......
Read more >
5 Things to Know About the iOS 12.3 Update - Gotta Be Mobile
In this guide to the iOS 12.3 update we'll take you through iOS 12.3's known changes, iOS 12.3 problems, places to look for...
Read more >
iOS 12.3.1 Released: Here's All You Need To Know About ...
And iOS 12.1.4 also fixed a bug where an app would be able to gain elevated privileges and an issue with Live Photos...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found