-
Notifications
You must be signed in to change notification settings - Fork 8
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
TypeError: Cannot read property 'message' of undefined #42
Comments
@jaydgruber also ran into this recently with the upgrade. He is locked out of his github account for the moment, so he asked me to post here, but it appears the issue is due to the // https://github.com/ember-template-lint/eslint-plugin-hbs/blob/master/lib/rules/check-hbs-template-literals.js#L73
TaggedTemplateExpression: (node) => { // I think this needs to be an async function
if (node.tag.name === 'hbs') {
if (node.quasi.type === 'TemplateLiteral') {
let hbs = node.quasi.quasis[0].value.cooked
hbs = unindentAndStripSafeNewlines(hbs)
const results = linter.verify({source: hbs.toString(), moduleId: context.id}) // and I think this needs to await
if (results.length !== 0) {
// If I log from here, `results = Promise { <pending> }`
// so even though it has a length, `results[0] = undefined`
const firstLine = results[0].message.split('\n')[0]
const msg = `${results.length} error(s): ${firstLine}`
context.report(node, msg)
}
}
}
}, |
Yeah, the issue is that I don't think ESLint allows async here 🤔 |
@rwjblue wondering, should we add |
Ya probably :( |
This seems to have broken template lint integration with non-unstable ELS (
Sticking a (I realize that's not directly related to |
@dfreeman |
What's the situation with this? I've had |
I think this error appeared when I upgraded ember-template-lint to v3.
The text was updated successfully, but these errors were encountered: