Getters and setters are not supported for task groups
Closed this issue · 7 comments
Getting the following error:
ember-concurrency-decorators: Getters and setters are not supported for task groups.
Hopefully I'm doing something braindead here:
import Controller from '@ember/controller';
import { enqueueTaskGroup, task } from 'ember-concurrency-decorators';
export default class DashboardProfileController extends Controller {
@enqueueTaskGroup saveTaskGroup;
@task({ group: 'saveTaskGroup' }) saveUserTask = function*(e) {
e.preventDefault();
yield this.model.currentUser.save();
};
@task({ group: 'saveTaskGroup' }) saveOrganizationTask = function*(e) {
e.preventDefault();
yield this.model.organization.save();
};
}
Thanks in advance.
- Ember 3.5.1
- ember-concurrency 0.8.22
- ember-concurrency-decorators 0.2.0
LGTM. What version of ember-cli-babel and configuration are you using? Do you have typescript and / or @ember-decorators/babel-transforms installed? If so, which versions?
- ember-cli-babel 6.17.2
- No TypeScript
- @ember-decorators/babel-transforms 2.1.2
I have the transform-async-to-generator and transform-async-to-generator Babel plugins installed. That's it, I think.
Thank you. I will investigate this evening. In the meantime to unblock yourself, you can safely disable this assertion, without causing any ill effects. It was just meant as an aid to users.
Thank you! I rewrote it using the Ember object model, but I'll go back and give that a try.
This should not happen any more with 1.0.0-beta.1
.
Thanks @buschtoens! I'll check it out.
@mwpastore Be aware that this requires you to drop all stage 2 decorators and switch to stage 1 decorators though. 😅