diff --git a/src/metatags/seo-checks.js b/src/metatags/seo-checks.js index 7bd9c97c..c8e3788e 100644 --- a/src/metatags/seo-checks.js +++ b/src/metatags/seo-checks.js @@ -168,8 +168,10 @@ class SeoChecks { this.allTags[H1][tag].count += 1; if (this.allTags[H1][tag].count > 1) { - this.detectedTags[H1][NON_UNIQUE] ??= {}; - this.detectedTags[H1][NON_UNIQUE][tag] = { ...this.allTags[H1][tag] }; + if (!this.detectedTags[H1][0] || !this.detectedTags[H1][0][NON_UNIQUE]) { + this.detectedTags[H1].unshift({ [NON_UNIQUE]: {} }); + } + this.detectedTags[H1][0][NON_UNIQUE][tag] = { ...this.allTags[H1][tag] }; } }); }