samedi 21 octobre 2017

emberfire: this._ref.push is not a function

The Issue

I seem to be getting the following error with emberfire, I followed the documentation yet still get the error:

Uncaught TypeError: this._ref.push is not a function
    at Class.generateIdForRecord (firebase.js:75)
    at Class._generateId (-private.js:10359)
    at Class.createRecord (-private.js:10325)
    at Class.test (home.js:13)
    at Class.send (action_handler.js:32)
    at action.js:141
    at exports.flaggedInstrument (ember-metal.js:3730)
    at action.js:140
    at Backburner.run (backburner.js:537)
    at run (ember-metal.js:4267)

The following code is where the error comes from, the code is simply placed in an action in a controller called home:

var newGlobal = this.store.createRecord('global', {
  about: 'test',
});
newGlobal.save();

The rules on the database are set up as:

{
  "rules": {
    ".read": true,
    ".write": true
  }
}

and the database is empty.

I have also setup config/environment.js

Any ideas please?

Thank you in advance

Helpful Links

emberfire

Emberfire guide

Found these issues but they didn't help with my issue




Aucun commentaire:

Enregistrer un commentaire