简体   繁体   English

“尝试处理事件`reloadRecord` <App.User:ember820:me> 处于root.deleted.saved状态时。 ”

[英]“Attempted to handle event `reloadRecord` on <App.User:ember820:me> while in state root.deleted.saved. ”

I tried searching for same kind off issue if asked already but couldn't find exactly. 如果已经问过,我尝试搜索同类问题,但找不到确切的问题。 My problem is:- 我的问题是:

I'm calling a function from a .handlebars class with the required parameters but while it is calling the function, at one point where it's calling reload() function, it throws exception. 我正在从.handlebars类中调用具有所需参数的函数,但是在调用该函数时,在调用reload()函数的某一时刻,它引发异常。

The code snippet is like:- 该代码段类似于:

  saveBookmark: function saveBookmark(name, value, version) {
    var self = this;
    this.get('user').reload().then(function () {
      var bookmarks = self.get('bookmarks') || [];
      var newBookmarkId = bookmarks.sortBy('id').getWithDefault('lastObject.id', 0) + 1;
      var date = moment().format('YYYY-MM-DD');
      bookmarks.push({ key: self.get('key'), version: version, id: newBookmarkId, name: name, value: value, date: date });
      self.set('bookmarks', bookmarks);
      self.send('savePreferences');
    });
  },

So, the exact line where it;s throwing error is:- 因此,它的抛出错误的确切行是:

this.get('user').reload()

However, on browser console, I can find the value of 但是,在浏览器控制台上,我可以找到

this.get('user')

Firther, I can not make changes to this function as this is generic and is being used aross several places and working fine. 此外,我无法对此功能进行更改,因为它是通用的,已经在多个地方使用并且工作正常。

If you could provide me some idea of occurrence of this issue to resolve would be of much help. 如果您能为我提供一些解决此问题的想法,将大有帮助。

The exception I'm getting is:- 我得到的例外是:-

"Attempted to handle event `reloadRecord` on <App.User:ember820:me> while in state root.deleted.saved. "

PS:- I'm new to Ember.js. PS:-我是Ember.js的新手。

That error means your user object (the one you refer to with this.get('user') ) is in an invalid state (did it get deleted somewhere else?). 该错误表示您的user对象(您使用this.get('user')引用的对象)处于无效状态(是否已将其删除到其他位置?)。 And so the code you are writing is complaining that it can't reload a deleted model ... 因此,您正在编写的代码抱怨无法重新加载已删除的模型...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在状态为“ root.loaded.saved”时尝试处理事件“ becameInvalid” - Attempted to handle event `becameInvalid` while in state 'root.loaded.saved' 在状态root.loaded.updated.inFlight中尝试处理事件`willCommit` - Attempted to handle event `willCommit` on while in state root.loaded.updated.inFlight 错误:删除记录模型余烬时尝试处理事件`didSetProperty` - Error: Attempted to handle event `didSetProperty` when Deleting record model ember Ember JS,在状态为root.loaded.updated.uncommitted的Transformer handeling事件`didCommit`中解析数据时出错。“ - Ember JS, Error while parsing Data in Transformer handeling event `didCommit` in state root.loaded.updated.uncommitted." 在 SvelteKit 中,如果未保存用户状态,是否有办法取消 popstate 事件? - In SvelteKit, is there a way to cancel a popstate event if user state isn't saved? 即使在注册时指定根范围后,Service Worker 也会被删除并且不会收到推送事件 - Service Worker gets deleted and does not receive push event even after specifying root scope while registering Ember集成:触发根元素上的click事件 - Ember Integration: Trigger click event on root element Ember Component句柄jQuery事件处理程序 - Ember Component handle jQuery event handlers 在事件监听器中反应挂钩保存状态错误? - React hook saved state in Event Listener wrong? 这是处理回留用户的安全方法吗? - Is it a secure way to handle returning user in ember?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM