ember-template-recast
ember-template-recast copied to clipboard
ast.params.map is not a function error
Moved from https://github.com/ember-template-lint/ember-template-lint/issues/2027 - I was seeing an error when attempting to fix the no-model-argument-in-route-templates
.
Should this statement be guarded in a ast.params.length
check?
https://github.com/ember-template-lint/ember-template-recast/blob/v5.0.3/src/parse-result.ts#L346
The ast
used on line 346 can be of one of the following types:
https://github.com/ember-template-lint/ember-template-recast/blob/ec7c070c73db48a122dcf6608e5653de10226fa4/src/parse-result.ts#L274-L278
Each of these types of node have a params
property. It means that ast.params
is never supposed to be something else than an array.
Have you been able to isolate the template causing the ast.params.map is not a function error
error? If yes do you mind sharing it?