When retrieving data from Firebase
, I am attempting to update the properties
of the object
being displayed on the UI. However, whenever I try to make any changes to the data, an error is thrown.
Error in v-on handler: "TypeError: Cannot use 'in' operator to search for 'cc' in null.
I am currently using Vue in development mode in conjunction with Firebase
. Is there a key concept that I might be overlooking?
beforeCreate(){
sref.get().then(sc => {
if (sc.exists) {
console.log(sc.data()); // This logs the correct data
this.school = sc.data(); // This works as well
this.cc = sc.data().cc; // This too
this.name = sc.data().name;
However, when I execute
console.log(this.name)
In the created()
hook, it returns undefined and any attempt to modify or update it results in an error:
[Vue warn]: Cannot set reactive property on undefined, null, or primitive value: null
[Vue warn]: Error in v-on handler: "TypeError: Cannot use 'in' operator to search for 'cc' in null"
found in
---> <VSelect>
<VForm>
<VCard>
TypeError: Cannot use 'in' operator to search for 'cc' in null
at Proxy.set