adopted-ember-addons / adopted-ember-addons/emberx-select
Error: Assertion Failed: You attempted to update `[]` on `<Array:ember187>`, but it had already been used previously in the same computation. Attempting to update a value after using it in a computation can cause logical errors, infinite revalidation bugs, and performance issues, and is not supported.
- 主要語言
- JavaScript
- 星號
- 198
- 分支
- 77
- PR 合併指標
- 30 天內沒有已合併 PR
描述
### Version of x-select: 3.1.1
### Ember Version / Ember CLI Version:
**Ember Version:** 3.22.0
**Ember CLI Version:** 3.22.0
### Actual Behavior
The following error is thrown:
> Uncaught Error: Assertion Failed: You attempted to update `[]` on ``, but it had already been used previously in the same computation. Attempting to update a value after using it in a computation can cause logical errors, infinite revalidation bugs, and performance issues, and is not supported.
### Steps To Reproduce:
Click between the One and Two links [on this reproduction repo](https://github.com/skaterdav85/emberx-select-bug/pull/1) and you'll see the following error:

### Notes
Based on [@rwjblue's comment](https://github.com/emberjs/ember.js/issues/19110#issuecomment-682102952), I think this has to do with [`unregister` getting called in `x-option`'s `willDestroyElement`](https://github.com/adopted-ember-addons/emberx-select/blob/1051eeba039a84e28233fa8c48cc6d5b4546770a/addon/components/x-option.js#L84). `unregister` points to the [`unregisterOption` action](https://github.com/adopted-ember-addons/emberx-select/blob/1051eeba039a84e28233fa8c48cc6d5b4546770a/addon/components/x-select.js#L276) which does a `removeObject`.
貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
Reproduce the assertion by clicking between the One and Two links in the linked reproduction repository. Read addon/components/x-option.js around willDestroyElement and addon/components/x-select.js around unregisterOption, then trace the removeObject call. Done means the same interaction no longer throws the Ember assertion.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- javascript
- 領域
- frontend
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 停滯
- 描述清晰度
- 描述清楚
- 新手友好度
- 45/100