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

Subscription not defined in react native - debug mode #1711

Closed
cosinus84 opened this issue Mar 13, 2018 · 38 comments
Closed

Subscription not defined in react native - debug mode #1711

cosinus84 opened this issue Mar 13, 2018 · 38 comments

Comments

@cosinus84
Copy link

cosinus84 commented Mar 13, 2018

Goals

Debugging react native application using realm 2.3.0. The bug is generating when importing realm.
All works fine in non-debug mode.
In 2.2.15 debug works ok.

simulator screen shot - iphone 6 - 2018-03-14 at 00 33 53

exports.default = Realm;
util.createMethods(Realm.prototype, _constants.objectTypes.REALM, ['addListener', 'removeListener', 'removeAllListeners', 'close', '_waitForDownload', '_objectForObjectId']);
util.createMethods(Realm.prototype, _constants.objectTypes.REALM, ['delete', 'deleteModel', 'deleteAll', 'write', 'compact', 'beginTransaction', 'commitTransaction', 'cancelTransaction'], true);
var Sync = {
User: _user2.default,
Session: _session2.default,
Subscription: Subscription
};
index.bundle?platform=ios&dev=true&minify=false:13121 Subscription is not defined

Actual Results

Steps to Reproduce

Code Sample

Version of Realm and Tooling

  • Realm JS SDK Version: 2.3.0
  • Node or React Native: 0.54.2
  • Client OS & Version: ios simulator
  • Which debugger for React Native: React native debugger
@cosinus84 cosinus84 changed the title Subscription not defined in react native debug mode Subscription not defined in react native - debug mode Mar 13, 2018
@skizzo
Copy link

skizzo commented Mar 13, 2018

+1

@ming436534
Copy link

ming436534 commented Mar 14, 2018

I solved this problem by uninstalling the app from the simulator and build it again

Edited: Sorry it turns out that this method is not working for me as well...

@cosinus84
Copy link
Author

cosinus84 commented Mar 14, 2018

Didnt worked for me, I even reset the simulator, reinstall modules, link aigan, etc. All worked fine with no debug mode. In debug mode the error appears again and if I comment import realm then debug mode works. For the moment I use 2.2.15 if i upgrade to 2.3.0 I will get the same error.

Just 1 min ago updated back to 2.3.0, uninstall the application from simulator, started again the builder etc, => Subscription is not defined

@pedrozero-com
Copy link

Same issue here. Downgrading from realm@2.3.0 to realm@2.2.15 solves this problem.

@payucads
Copy link

+1

@liamjones
Copy link

liamjones commented Mar 15, 2018

Looks like it might be failing because #1583 changed browser/index.js to add Subscription to the Sync const but there's no import for Subscription? (link)

At least, that seems to be where it's falling over in the debugger

@kaixinfu
Copy link

+1

@arshbot
Copy link

arshbot commented Mar 27, 2018

Updating to 2.3.3 and deleting the app from simulator and rebuilding worked for me

Update: It does not work.. it just seems to silence the issue but communicating with realm results in the app freezing

@saarnilauri
Copy link

Having the same issue.

@cosinus84
Copy link
Author

cosinus84 commented Mar 28, 2018

2.3.3 still not fixed, same issues.
I really don't understand how everyone(besides us here) using 2.3.3 can debug their realm application. How does the realm team debug their application in react native with 2.3.3

@V1sk
Copy link

V1sk commented Mar 28, 2018

+1

@jadelmir
Copy link

I downgraded from 2.3.0 to 2.2.8
using npm:
install realm@2.2.8
and after that
run: react-native link
it redownloaded the cocoa packages and it worked fine for me
good luck 🥇

@ameenmattar
Copy link

Thank you @jadelmir , i followed your steps and it worked 👍

@V1sk
Copy link

V1sk commented Mar 29, 2018

Downgrading realm@2.3.3 to realm@2.2.15 still has this issue

@saarnilauri
Copy link

@V1sk I had the same issue. In my case, one of my apps dependencies had a child dependency to the realm js. Check your child dependencies.

@uwajacques
Copy link

@jadelmir Thanks, it works for me

@jeprojects
Copy link

Same here, any Realm 2.3.+ produces this error. 2.2.18 works fine.

@donni106
Copy link

donni106 commented Apr 3, 2018

Same here, Realm 2.3.3 produces this error. 2.2.18 works fine.

@Dexwell
Copy link

Dexwell commented Apr 16, 2018

+1, please fix this critical bug

@kneth
Copy link
Member

kneth commented Apr 17, 2018

Please see #1744

@arshbot
Copy link

arshbot commented Apr 19, 2018

Installed 2.3.3, still getting the Subscription is not defined error. Not getting it with 2.2.18

@febeling
Copy link

So now that #1744 is in, and while we await the upcoming release, the fix could be confirmed with a package build from master. I checked but didn't see instructions that I understand.

Anyone know how to build the package? (Just specifying realm/realm-js#master as dep isn't working.)

@juliancorrea
Copy link

juliancorrea commented Apr 20, 2018

Same here. I've created a new project now and bug in 2.3.4 persists.
@kneth , the @artutra's commit doesn't released, right?
The last change in the last tag (2.3.4) was 2 months ago...

@kneth
Copy link
Member

kneth commented Apr 20, 2018

No, it hasn't been released.

And 2.3.4 was released last week: https://github.com/realm/realm-js/releases/tag/v2.3.4

@fredimartins
Copy link

Same here, 2.3.4 shows this error.
Downgraded to 2.2.18 and run android again works for me.

@kneth
Copy link
Member

kneth commented Apr 25, 2018

I have release 2.3.5, please report back if it doesn't work.

@Dexwell
Copy link

Dexwell commented Apr 25, 2018

@kneth I get the error "Cannot redefine property: logout"

@jeprojects
Copy link

@kneth Same problem as @Dexwell

@artutra
Copy link
Contributor

artutra commented Apr 25, 2018

@Dexwell @jeprojects I mentioned this error in #1744 comment section, but I did not get answers about it.
I was able to resolve by changing 'logout' to '_logout' here:

'logout',

Apparently this function is called here:
this._logout();

@maxhalty
Copy link

Hi guys! We are having the same problem over here...please let us know when you think a new release with this issue fixed will be published. thanks!

@kneth
Copy link
Member

kneth commented Apr 26, 2018

I have unpublished 2.3.5 and released it as 2.4.0 (and sneaked the logout fix in).

@kneth kneth closed this as completed Apr 26, 2018
seland added a commit to Bit-Nation/BITNATION-Pangea-mobile that referenced this issue May 1, 2018
@HZSamir
Copy link

HZSamir commented May 8, 2018

I am still encountering this issue on 2.4.0

@artutra
Copy link
Contributor

artutra commented May 8, 2018

@Unforgiven-wanda Are you using react-native-queue package? It uses realm@2.0.12

@HZSamir
Copy link

HZSamir commented May 8, 2018

@artutra No. I believe none of my libs have realm as a dependency.
FYI running on Ubuntu 17.10, Node 10, on emulator running Android 7.0

@kneth
Copy link
Member

kneth commented May 14, 2018

@Unforgiven-wanda Maybe checking node_modules manually is worth doing.

@HZSamir
Copy link

HZSamir commented May 14, 2018

@kneth Deleting node_modules, cleaning the build files and reinstalling everything seems to have fixed it for me, although I have no idea why; the same procedure didn't take a few days ago.
All in all, Realm is still wildly unstable (when it comes to debugging) on RN. I swear I start praying to every divinity whenever I fiddle with it.

@kneth
Copy link
Member

kneth commented May 15, 2018

@Unforgiven-wanda RN debugging is our weakest point, please read #491 (comment)

@cosinus84
Copy link
Author

I just tested and #1711 is fixed in 2.4.1

marknuzz pushed a commit to Bit-Nation/BITNATION-Pangea-mobile that referenced this issue Nov 14, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests