Closed niranjan94 closed 5 years ago
This is caused by https://github.com/babel/babel/issues/9852.
You can either:
README.md
, e.g.:
export default class ExampleComponent extends Component {
@task
doStuff = function*() {
// ...
};
}
ember-decorators
plus @ember-decorators/babel-transforms
to get stage 2 decorators (not recommended)@buschtoens thanks for the update 😄 Will wait for https://github.com/babel/babel/pull/9912 to be merged. Using the assignment syntax in the meantime.
I just merged #54 and released it as v1.0.0-beta.3
. If you manually apply the patch to @babel/parser
as described in What happened to the fancy generator method syntax? or wait for it to be released officially, you can use the generator method syntax again.
@buschtoens looks like the latest Babel release (7 days ago) is v7.5.5, which presumably includes https://github.com/babel/babel/pull/9912 (merged 24 days ago). Does that mean this patch work-around is no longer needed in order to use the "fancy generator method syntax" and the note can be removed/examples updated?
FWIW, looks like ember-cli v3.11 still only requires ^7.4.3, while current HEAD requires ^7.5.5, which I think means this can be relied on once 3.12(-beta?) ships?
@gabrielgrant Yes. The fix was already released in v7.5.0
. So, if you're on at least that version, everything should be groovy.
Also, the version of @babel/core
in ember-cli
itself doesn't actually matter. It's the version in ember-cli-babel
, which is a dependency in your project's package.json
.
If you are using yarn, you can force an upgrade of this @babel/core
dependency by setting a resolution. If you're using npm or don't want to use a resolution, a clean re-installation of the dependencies (delete node_modules
and any package manager lock files) should also do the trick.
Code snippet in question:
Error on build:
Dependencies include:
And not using
@ember-decorators/babel-transforms