Running "vue-meta": "^1.5.5"
Cannot read property 'hasOwnProperty' of undefined on some route changes, not consistent. I have seen Cannot read property 'title' of undefined on previous versions, might be related.
Project based on https://github.com/vuejs/vue-hackernews-2.0
affected section in vue-meta.js:
```// collect & aggregate child options if deep = true
if (deep && component.$children.length) {
component.$children.forEach(function (childComponent) {
result = getComponentOption({
component: childComponent,
option: option,
deep: deep,
arrayMerge: arrayMerge
}, result);
});
}
if (metaTemplateKeyName && result.hasOwnProperty('meta')) {
result.meta = Object.keys(result.meta).map(function (metaKey) {
var metaObject = result.meta[metaKey];
if (!metaObject.hasOwnProperty(metaTemplateKeyName) || !metaObject.hasOwnProperty(contentKeyName) || typeof metaObject[metaTemplateKeyName] === 'undefined') {
return result.meta[metaKey]
}
var template = metaObject[metaTemplateKeyName];
delete metaObject[metaTemplateKeyName];
if (template) {
metaObject.content = typeof template === 'function' ? template(metaObject.content) : template.replace(/%s/g, metaObject.content);
}
return metaObject
});
}
return result
}
Hi Wilco, did you find a solution ? I'm running into the same issue.
Needs reproduction.
When testing this it seems to be triggered by not returning anything from metaInfo (or head in nuxt) as mentioned in the linked issue
Closing as changes for this issue are included in the v2 release candidate. Please help us testing the release candidate and report any follow-ups in a new issue
Most helpful comment
When testing this it seems to be triggered by not returning anything from
metaInfo(orheadin nuxt) as mentioned in the linked issue