Cannot read property 'error' of null Memo Backend Memo

260 views Asked by At

Good, I'm trying to run the demo monaca backend, but I can not register or login, followed all these steps http://docs.monaca.mobi/cur/en/sampleapp/samples/backend_memo/

But to test the debugger gives me error:

Uncaught TypeError: Can not read property 'error' of null

In line 21: app.js in the method of registration:

onRegisterBtn function ()
{
   var email = $ ("# reg_email") val ().;
   var password = $ ("# reg_password") val ().;
console.log (MC); // ACA gives the error
   MC.User.register (email, password)
     .done (function ()
     {
       console.log ('Registration is success!' + MC.User._oid);
       $ .mobile.changePage ('# ListPage');
     })
     .fail (function (err)
     {
         console.log ('FAILED');
       alert ('Registration failed!');
       console.error (JSON.stringify (err));
     });
}

I guess can not connect to the User collection, but why?

1

There are 1 answers

0
John Gonzalez On

You may need to assign your memo id - you can try this on the lines just before that snippet.

var currentMemoID = "XXXXXXXXXXXXXXXXXXXXXXX"; 

you can get your MemoID from your config xml after you have setup the collection for the monaca backend memo.

<preference name="monaca:MonacaBackendId" value=".......