[英]Why am i getting assertion error of FirebaseAppService
Version info 版本信息
DEBUG: -------------------------------
DEBUG: Ember : 3.4.4
DEBUG: Ember Data : 3.11.0
DEBUG: EmberFire : 3.0.0-rc.3
DEBUG: -------------------------------
Steps to reproduce Try to save record on my firebase storage in controller: 重现步骤尝试将记录保存在控制器的Firebase存储中:
import Controller from '@ember/controller';
import { computed } from '@ember/object';
import v4 from 'npm:uuid/v4'
export default Controller.extend({
emailFromValue: '',
header: 'Coming soon',
alertMessage: '',
showAlert: false,
isDisabled: computed('emailFromValue', function() {
return !this.emailFromValue.match(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/);
}),
actions: {
changeEmailValue({ target: { value } }) {
this.set('emailFromValue', value);
},
requestInvitation(e){
e.preventDefault();
this.store.createRecord('invitation', { id:v4(), email: this.emailFromValue}).save()
this.set('alertMessage',`Thank you! We saved your email address: ${this.emailFromValue}`)
this.set('showAlert', true)
}
}
});
config of firebase in environment: Firebase在环境中的配置:
firebase: {
apiKey: "AIzaSyAhO6f8wKS-...",
authDomain: "...9e.firebaseapp.com",
databaseURL: "...39e.firebaseio.com",
projectId: "...39e",
storageBucket: "",
messagingSenderId: "...45128",
appId: "...94d4964176"
},
Expected behavior Successful save the data 预期行为成功保存数据
Actual behavior after calling save method of record i've got an error: 调用记录的保存方法后的实际行为我遇到了一个错误:
index.js:163 Uncaught Error: Assertion Failed: You must call `this._super(...arguments);` when overriding `init` on a framework object. Please update <libraries-app@service:firebase-app::ember204> to call `this._super(...arguments);` from `init`.
at assert (index.js:163)
at FirebaseAppService.__ASSERT_INIT_WAS_CALLED__ember1565768194366642062813808__ (object.js:88)
at sendEvent (metal.js:462)
at initialize (core_object.js:107)
at Function.create (core_object.js:692)
at FactoryManager.create (container.js:549)
at instantiateFactory (container.js:359)
at lookup (container.js:287)
at Container.lookup (container.js:131)
at Class.lookup (container_proxy.js:78)
How have i already tried to solve it: 我如何尝试解决它:
Same thing happened to me yesterday (your question was 6 hours old). 昨天我也发生了同样的事情(您的问题是6个小时大了)。 Since your ember data is 3.11 im going to assume that your ember-source is also 3.11. 由于您的余烬数据为3.11,因此我将假设您的余烬源也为3.11。
Fixed it by changing "ember-source" "~3.10"
from 3.11.1 通过从3.11.1更改"ember-source" "~3.10"
来修复此问题
Then I deleted my node_modules directory and ran npm install
again. 然后,我删除了node_modules目录,然后再次运行npm install
。
My GUESS is the warning is because something new was added in 3.11 我的GUESS警告是因为3.11中添加了新内容
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.