Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem After Recently Updating Realm JS #4657

Closed
s1tony opened this issue Jun 17, 2022 · 6 comments · Fixed by #4660
Closed

Problem After Recently Updating Realm JS #4657

s1tony opened this issue Jun 17, 2022 · 6 comments · Fixed by #4660

Comments

@s1tony
Copy link

s1tony commented Jun 17, 2022

I have been successfully developing a React Native application using Realm and specifically Flexible Sync. Things were working until recently, after updating to Realm JavaScript v10.19.1.

I am receiving the following message back when attempting to call subscriptions.update:

TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[0], "@realm.io/common").symbols.PROXY_TARGET')

I am developing on a Windows 10 box for the Android platform.

Any ideas?

@hachther
Copy link

The issue here is the version of @realm.io/common.
The version installed by realm is "0.1.1" but the needed version is "0.1.2".

See below I fixed my issue:

yarn add @realm.io/common
rm -rf node_modules/realm/node_modules/@realm.io

@tomduncalf
Copy link
Contributor

Hi @s1tony @hachther, thanks for the report.

It looks like we missed updating the dependency in the package.json, sorry for the trouble. @hachther's workaround should help temporarily.

I will look to get a fixed version published as soon as possible and will update this issue when I have done so. I will also look into why our automated tests didn't catch this issue!

@tomduncalf
Copy link
Contributor

Based on my testing, a clean install of realm should pull in the right version of @realm.io/common (0.1.2), as it is published on npm and our package.json specifies ^0.1.1... but it seems that if you already have common 0.1.1 installed, npm won't upgrade it, so if you are upgrading Realm you can hit this.

Therefore @s1tony a workaround for now should be just to delete your node_modules and re-install, which should pull in @realm.io/common@0.1.2 – no need to manually install it.

Regardless we should fix this in our package.json, which I'm doing now.

@tomduncalf
Copy link
Contributor

tomduncalf commented Jun 20, 2022

@s1tony @hachther I just released realm@10.19.2 which should fix this issue, apologies for the inconvenience.

Because it relates to the published version of the package (which is not published at the time of running tests) and only occurs on upgrades, this is actually quite tricky to catch in an automated test, but we are going to look to add an automated check to make sure that our packages reference the latest versions of each other which should prevent this happening in future. For now, I've added an item to our PR merge checklist to verify that we have updated the package version when necessary.

@s1tony
Copy link
Author

s1tony commented Jun 20, 2022 via email

@s1tony
Copy link
Author

s1tony commented Jun 20, 2022

Before your post, I had actually worked around this issue by editing mutable-subscription-set.js:

const instanceMethods = {
add(query, options) {
return this._add(query, options);
},

remove(query) {
return this._remove(query);
},
};

This alleviating the issue ;)

Thanks again.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants