Open runspired opened 2 years ago
utilizing npx ember-template-recast@{version}
I worked back to this affects all versions of 6.x. I'm not sure why the default for npx ember-template-recast
was 5.x until this week (the particular transform this threw for was working fine via this execution only 2 weeks ago).
The global node on my machine is v17.4.0
, the project node is v14.17.6
I ran into this error while upgrading @glimmer/syntax a while ago here in template-recast: https://github.com/ember-template-lint/ember-template-recast/pull/627/files#diff-3a4f3cd1ddd47fc9011205425ed890cfab4f79a21f7cbda7ad8055cb0ef82ff2R11
If we want to fix this, we should do it in @glimmer/syntax. As far as I remember it is a very light fix there (a missing ?).
As a work around, you can provide an empty object as a second argument.
@dcyriller confirm, it came into glimmer/syntax in this PR https://github.com/glimmerjs/glimmer-vm/commit/8e11b91167d55995c7400135460a0d4c8b2a4164
we'd just need to have options = {} as the default here: https://github.com/glimmerjs/glimmer-vm/blob/a397f489047d89c4b2b6f4bfc4415e780c054b99/packages/%40glimmer/syntax/lib/v1/public-builders.ts#L205
Error:
Example Working in 5.x
Transform:
Code to modify: