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

Node.js and Sync can't found 'User' #852

Closed
gpulido opened this issue Feb 8, 2017 · 11 comments
Closed

Node.js and Sync can't found 'User' #852

gpulido opened this issue Feb 8, 2017 · 11 comments
Assignees

Comments

@gpulido
Copy link

gpulido commented Feb 8, 2017

Hello,
I'm trying to follow the documentation regarding using realm with Node.js and the sync functionallity.

I'm running the realm mobile plattform in a ubuntu 16.04 virtual machine and it is working properly.
I'm using node v7.5.0 and npm 4.1.2
I installed realm for nodeusing:
npm install --save realm

And I test it locally using the NodeInterprocess example and it is working.

However when I try to use the example code to sync:

'use strict';
var Realm = require('realm');

Realm.Sync.User.login(/* ... */, (error, user) => {
  if (!error) {
    var realm = new Realm({
      sync: {
        user: user,
        url: 'realm://object-server-url:9080/~/my-realm',
      },
      schema: [/* ... */]
    });

    realm.write(() => { 
      /* ... */
    })
  }
})

I receive the following error:

Realm.Sync.User.login('realm://192.168.1.230:9080', 'user@email.com', 'password', (error, user) => {
          ^

TypeError: Cannot read property 'User' of undefined
    at Object.<anonymous> 
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:418:7)
    at startup (bootstrap_node.js:139:9)
    at bootstrap_node.js:533:3

Am I missing something?

@kristiandupont
Copy link
Contributor

Sorry, sync is not available in the developer edition when running on Linux. I will make sure there is a descriptive error message for this.

@gpulido
Copy link
Author

gpulido commented Feb 9, 2017

Is sync available in any developer edition?
And more important, it is going to be available in linux in the future?
The documentation on the Realm javascript should also to be updated as it doesn't specify that is not available.

@kristiandupont
Copy link
Contributor

Yes, it's available on MacOS. Whether it will be on Linux in the future, I am not in a position to say. It might happen but I can't promise anything. You are right that we need to document this.

@fotiDim
Copy link

fotiDim commented Mar 9, 2017

@kristiandupont what is the reasoning behind making sync only available on MacOS? It doesn't make sense to me. If it's a server chances are it will be Linux.

@gpulido
Copy link
Author

gpulido commented Mar 11, 2017

@kristiandupont Does the new universal Node.js support for windows announced here (https://realm.io/news/realm-javascript-node-js-windows/ have Sync included?

@kristiandupont
Copy link
Contributor

@fotiDim the reason is that it's actually a paid feature, but we want to allow people to play with it.
@gpulido no, sync for Windows is not supported yet. This is for technical reasons purely though, I can't say if it will be in the developer edition when fixed.

@gpulido
Copy link
Author

gpulido commented Mar 13, 2017

@kristiandupont Thank you for clarify it.
Unfortunatelly, in my case, I'm using it on a opensource project that I'm giving free so to pay 1800$ / month is imposible neither for me, neither for my "client" (a social archery club).
Have Realm though about using double licensing or giving licenses for open source and free projects?

@kristiandupont
Copy link
Contributor

This has been requested before. It's a reasonable request but at the time we are not considering it. Realm produces a lot of open source code -- the mobile database and all of the local sdk's are completely free and open source. The professional and enterprise editions of sync are the only products we charge for and we need to focus our efforts somewhat.
That is just the current situation though, as we are a young company many things change so subscribe to our newsletter and maybe you will be positively surprised one day :-)

@fotiDim
Copy link

fotiDim commented Mar 13, 2017

@kristiandupont according to https://realm.io/pricing "Two-way, Realtime Synchronization" is supported for the Developer Edition. If this is only for MacOS you should explicitly mention that.

What about Server-side Access and Event Handling? Are they supported on any OS for the Developer Edition?

@Dids
Copy link

Dids commented Mar 13, 2017

@fotiDim I know that the free edition of Realm Mobile Database works fine with Xamarin.Forms (.NET) apps, at least for iOS and Android.
That does make you wonder why JS would be any different from a technical standpoint.

@kristiandupont
Copy link
Contributor

@fotiDim you are right, that is confusing. I will talk with marketing about that.
@Dids the Mobile Database (without sync) works on all those platforms. Sync is intentionally disabled in Node.js for Linux, and doesn't currently work on Windows. Sync is enabled in iOS and Android for both React Native and Xamarin.

@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

4 participants