realm-js: Crash on iOS 14.5 beta: Attempting to change configurable attribute of unconfigurable property
Expected Results
Not to crash.
Actual Results
Crashed on iOS 14.5 beta. All other iOS versions are fine.
If we don’t use Realm in JS, then everything is fine. But if we add one line to import Realm:
import Realm from 'realm';
It crashed with the following error: Attempting to change configurable attribute of unconfigurable property.
And crashed when running the following Object.defineProperties() in lib/extensions.js
of realm-js:
Object.defineProperties(realmConstructor, getOwnPropertyDescriptors({
_extendQueryBasedSchema(schema) {
addSchemaIfNeeded(schema, realmConstructor.Permissions.Class);
addSchemaIfNeeded(schema, realmConstructor.Permissions.Permission);
addSchemaIfNeeded(schema, realmConstructor.Permissions.Realm);
addSchemaIfNeeded(schema, realmConstructor.Permissions.Role);
addSchemaIfNeeded(schema, realmConstructor.Permissions.User);
addSchemaIfNeeded(schema, realmConstructor.Subscription.ResultSets);
},
// Creates the user agent description for the JS binding itself. Users must specify the application
// user agent using Realm.Sync.setUserAgent(...)
_createUserAgentDescription() {
// Detect if in ReactNative (running on a phone) or in a Node.js environment
// Credit: https://stackoverflow.com/questions/39468022/how-do-i-know-if-my-code-is-running-as-react-native
try {
var userAgent = "RealmJS/";
userAgent = userAgent + require('../package.json').version + " (" + context + ", ";
if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
// Running on ReactNative
const Platform = require('react-native').Platform;
userAgent += Platform.OS + ", v" + Platform.Version;
} else {
// Running on a normal machine
userAgent += process.version;
}
return userAgent += ")";
} catch (e) {
return "RealmJS/Unknown"
}
},
}));
Maybe due to some change in iOS 14.5 JavaScript core?
Steps to Reproduce
1.Setup a RN project and import realm-js 2.Run the App on iOS 14.5 beta.
Not sure whether it’s related to my RN version (0.59). But it all worked fine until the recently released iOS 14.5 beta. Tried Relam JS 5.0.5 and 6.1.5, both has the same issue.
Code Sample
import Realm from 'realm';
Version of Realm and Tooling
- Realm JS SDK Version: 5.0.5 and 6.1.5
- Node or React Native: RN 0.59.10
- Client OS & Version: iOS 14.5 beta
- Which debugger for React Native: None
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 13
- Comments: 23 (7 by maintainers)
@kneth is there any update on this? We don’t want our live app to crash when iOS 14.5 releases.
We upgraded realm js to v10.2.0 from 3.6.3, initial testing shows this fixed the issue, the app no longer crashes on iOS 14.5 beta.
We upgraded from 6 to 10
FYI that this issue is potentially resolved in ios 14.5 beta 2
This is just from our testing, unfortunately you have more formal information than I do here. The app was crashing on 14.5 beta, I’m fairly certain due to this issue, and doesn’t seem to be on the latest beta release.
@steffenagger, Great work getting out a hotfix that quick. I was wondering if this change would apply for older major versions (ie. v2.92)?
@Frans-L v6.1.6 has been released. Appreciate any feedback on the fix, and/or other problems encountered with the new xcode/ios beta.
@Frans-L without promising anything specific, this should be a matter of days.
I tried to upgrade realm from v3.2.0 to v10.2.0, but always failed with “missing realm constructor”, I searched the related issues and tried all the solutions but still failed with missing realm constructor. The error message is useless, of course we did pod install, RN version is 0.61.5, really upset about this.
@lakhman @Hannes-Endare Could you please help with this? What are your migration steps?
Upgrading to latest version of Realm seems to fix the problem. Can anyone else also confirm this?
Thanks @kneth can you provide a rough ETA?