为什么我得到FirebaseAppService的断言错误

为什么我得到FirebaseAppService的断言错误,firebase,ember.js,ember-data,emberfire,Firebase,Ember.js,Ember Data,Emberfire,版本信息 DEBUG: ------------------------------- DEBUG: Ember : 3.4.4 DEBUG: Ember Data : 3.11.0 DEBUG: EmberFire : 3.0.0-rc.3 DEBUG: ------------------------------- 复制步骤 尝试在控制器中的firebase存储器上保存记录: import Controller from '@ember/controller'; import

版本信息

DEBUG: -------------------------------
DEBUG: Ember      :  3.4.4
DEBUG: Ember Data : 3.11.0
DEBUG: EmberFire  : 3.0.0-rc.3
DEBUG: -------------------------------
复制步骤 尝试在控制器中的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)
    }
  }
});
firebase在环境中的配置:

firebase: {
      apiKey: "AIzaSyAhO6f8wKS-...",
      authDomain: "...9e.firebaseapp.com",
      databaseURL: "...39e.firebaseio.com",
      projectId: "...39e",
      storageBucket: "",
      messagingSenderId: "...45128",
      appId: "...94d4964176"
    },
预期行为 成功保存数据

实际行为 调用记录的保存方法后,我出现了一个错误:

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)
index.js:163未捕获错误:断言失败:必须调用'this.\u super(…参数);`在框架对象上重写'init'时。请更新以调用“this.\u super(…arguments);”从'init`。
在断言(index.js:163)
在FirebaseAppService上。断言初始化被称为成员1565768194366642062813808(object.js:88)
在sendEvent(metal.js:462)
初始化时(core_object.js:107)
在Function.create(core_object.js:692)
在FactoryManager.create(container.js:549)上
在实例化工厂(container.js:359)
查找时(container.js:287)
在Container.lookup(Container.js:131)
在Class.lookup(container_proxy.js:78)
我是如何解决这个问题的:

  • 安装了不同版本的emberfire和ember cli,但存在其他问题
  • 谷歌和github问题中的搜索错误,但没有得到任何结果

昨天我也遇到了同样的事情(你的问题提了6个小时)。由于你的余烬数据是3.11,我将假设你的余烬源也是3.11

通过将“ember source”~3.10“从3.11.1更改为
,对其进行了修复

然后我删除了我的node_modules目录并再次运行
npm安装


我猜这个警告是因为在3.11中添加了新的内容,昨天我也遇到了同样的事情(你的问题已经问了6个小时了)。由于你的余烬数据是3.11,我将假设你的余烬源也是3.11

通过将“ember source”~3.10“
从3.11.1更改为
,对其进行了修复

然后我删除了我的node_modules目录并再次运行
npm安装


我猜这个警告是因为3.11中添加了一些新功能

您是否使用了初始化功能?如果是,请添加此
this.\u super(…参数)到你的初始化函数。不,我没有使用任何初始化挂钩。你在使用任何初始化函数吗?如果是,请添加此
this.\u super(…参数)到您的init函数。不,我没有使用任何init钩子