Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ast.params.map is not a function error #610

Open
meirish opened this issue Jul 12, 2021 · 1 comment
Open

ast.params.map is not a function error #610

meirish opened this issue Jul 12, 2021 · 1 comment

Comments

@meirish
Copy link

meirish commented Jul 12, 2021

Moved from ember-template-lint/ember-template-lint#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

@dcyriller
Copy link
Member

The ast used on line 346 can be of one of the following types:

ast:
| AST.MustacheStatement
| AST.SubExpression
| AST.ElementModifierStatement
| AST.BlockStatement,

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants