question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot save records to Firebase

See original GitHub issue

Version info

DEBUG: Ember      : 2.5.1
DEBUG: Ember Data : 2.6.0
DEBUG: Firebase   : 3.0.4
DEBUG: EmberFire  : 2.0.0
DEBUG: jQuery     : 2.2.4

Test case

Steps to reproduce

Try saving a new record to Firebase

Expected behavior

I should be able to create new records using emberfire

Actual behavior

Getting this error: Uncaught TypeError: _firebase.default is not a constructor

Not sure if the following part of the guide is still relevant? https://www.firebase.com/docs/web/libraries/ember/guide.html#section-ember-add-firebase

If I change my adapter to look something like this:

import config from '../config/environment';
import Firebase from 'firebase';
import FirebaseAdapter from 'emberfire/adapters/firebase';

export default FirebaseAdapter.extend({
  firebase: Firebase.initializeApp(config.firebase)
});

Then I get a little farther along but an error is thrown inside Firebase.js inside generateIdForRecord method. firebase.js:72 Uncaught TypeError: this._ref.push is not a function

I have tried to find answers without any luck so help is very much appreciated.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
keithkelly31commented, Jun 23, 2016

@andrewevans I think your issue might have to do with the new Firebase default security rules. The new defaults require users to be authenticated in order to read or write data. You will probably need to change your rules or authenticate in order to avoid your error.

0reactions
andrewevanscommented, Jun 23, 2016

Similar issue. I have application.js as stated above and my environment.js as stated above, and I get this error, even though the data is exactly the values that firebase provided: firebase.js:186 Error: permission_denied at /posts/-KKv2I2d18Dn6CTBXKsn: Client doesn't have permission to access the desired data.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Saving Data | Firebase Realtime Database - Google
Stay organized with collections Save and categorize content based on your preferences. This document covers the four methods for writing data to your...
Read more >
Unable to save new data in firebase - Stack Overflow
I am trying to save new data in firebase under a node Visitors . i have already set some rules on that node....
Read more >
[Solved] Why can't I save and retrieve data from Firebase?
So try this: when the photo is taken, set a variable (not a list… let's keep this simple) to the green photo block....
Read more >
Cannot save records to Firebase · Issue #388 - GitHub
I ran into the same issue. The adapter configuration in the current docs is out of date. It should look like this now:...
Read more >
Adding data | Firestore - Google Cloud
import { doc, setDoc } from "firebase/firestore"; // Add a new document in collection "cities" await setDoc(doc(db, "cities", "LA"), { name: "Los Angeles",...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found