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.

Aperta
#277 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
198
Fork
77
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### 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:

![Screen Shot 2020-10-27 at 1 49 24 PM](https://user-images.githubusercontent.com/687449/97360472-7fca7f80-185b-11eb-8862-8e325ac0bf5b.png)

### 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`.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.