简体   繁体   English

为什么我会收到FirebaseAppService的断言错误

[英]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: 我如何尝试解决它:

  • Installed different versions of emberfire and ember-cli, but had another issues 安装了不同版本的emberfire和ember-cli,但是还有另一个问题
  • Searched error in google and github issues, but haven't got any result 在Google和github问题中搜索到错误,但没有任何结果

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.

相关问题 为什么我收到 AbstractDynamicObject$CustomMessageMissingMethodException 错误? - Why am I getting AbstractDynamicObject$CustomMessageMissingMethodException error? 为什么我会收到涉及“_kFIRLoggerInstanceID”的错误? - Why am I getting this error involving `_kFIRLoggerInstanceID`? 为什么我在Swift中收到有关段的文档引用错误? - Why am I getting a document reference error about segments in Swift? 为什么使用2个不同的字符串的UIImageRepresentation出现错误? - Why am I getting an error with UIImageRepresentation with 2 different strings? 为什么我在浏览器中收到 CORS 错误,但在 Postman 中却没有? - Why am I getting a CORS error in the browser but not in Postman? 为什么我在 flutter android 项目中收到 gradle 错误? - Why I am getting gradle error in flutter android project? 为什么我在使用 firebase 时收到尝试导入错误? - Why am I getting the attempted import error when using firebase? 为什么在尝试创建受众时出现错误? - Why I am getting an error when trying to create an audience? 为什么在Cordova Firebase插件中找不到AbstractSafeParcelable错误 - Why am I getting AbstractSafeParcelable not found error in Cordova Firebase plugin 为什么我会收到有关更新未安装组件的错误消息? - Why am I getting an error about updating an unmounted component?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM