adopted-ember-addons / adopted-ember-addons/ember-file-upload

Service cannot be used before helper

未關閉
#1,085 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
TypeScript
星號
196
分支
115
PR 合併指標
30 天內沒有已合併 PR

描述

## The problem

Given code:

```gts
import Component from '@glimmer/component';
import fileQueue from 'ember-file-upload/helpers/file-queue';

export default class Foo extends Component {
@service fileQueue;


{{! Block A }}


    {{#each this.fileQueue.files as |file|}}

  • {{file.name}}

  • {{/each}}


{{! Block B }}
{{#let (fileQueue) as |queue|}}


Select File

{{/let}}

}
```

The app will fail with:

```
ember.js:626 Uncaught (in promise) Error: Assertion Failed: You attempted to update `_value` on `TrackedStorageImpl`, 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.

`_value` was first used:

- While rendering:
-top-level
application
index
(unknown template-only component)
(result of a `unknown` helper)
(result of a `unknown` helper)
(result of a `unknown` helper)
false.files
```

- Curiously enough, if the `Block A` and `Block B` are swapped, the app works just fine

## Versions
- "ember-file-upload": "^9.1.0",
```sh
ember --version
ember-cli: 5.4.1
node: 20.17.0
os: darwin x64

pnpm --version
9.9.0
```

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。