nuxt-modules / i18n

I18n module for Nuxt
https://i18n.nuxtjs.org
MIT License
1.65k stars 465 forks source link

undefined title in google SERP? #2985

Open carlosvaldesweb opened 1 week ago

carlosvaldesweb commented 1 week ago

Environment

Production in Hosted in Vercel

Reproduction

You can check app.vue and index.vue to check how to set titles. https://stackblitz.com/edit/nuxt-starter-n1zpvy?file=app.vue

Describe the bug

Hello, I am having some SEO issues with my website. Previously, we used Laravel to develop the front end of our site, but we decided to migrate to Nuxt. The problem is that sometimes our website appears with the title "undefined" in Google's SERP. I haven't noticed which specific pages it happens with, but it has already happened with several search terms.

For example, if I search for the term "resumir textos", the page appears as "undefined", but it can stay like that for a few hours or days and then return to normal.

Captura de pantalla 2024-06-19 a la(s) 8 04 17 p m

I have noticed that other people have this specific problem with Nuxt because if I search on Google "undefined in google serp" without adding any programming language or any reference, another Nuxt topic appears.

https://www.reddit.com/r/Nuxt/comments/14cjpq6/undefined_in_title_on_google_serp/

Captura de pantalla 2024-06-19 a la(s) 8 28 03 p m

This is concerning because it is negatively affecting the SEO of our website.

Additional context

No response

Logs

No response

kazupon commented 1 week ago

Thank you for your reproduction!

I'll try to reproduce in my local with npm run build and npm run generate. Unfortunately, I could not reproduce it. Looking at both builds in the browser, the title seems to be rendering in my env.

@BobbieGoede Do you have any hints about any SEO issues?

BobbieGoede commented 1 week ago

Based on the reproduction the page title should either be a translation, a translation key or an empty string, I'm not sure in which scenario it would be undefined 🤔

The reddit post is actually about Nuxt 2 so it's not particularly relevant here but as one of the comments mentions this issue may be related to the page/crawler timing out while loading the page.

In either case, I don't see any indication that this issue is caused by the i18n module, not sure how to help out without being able to reproduce it 😅

github-actions[bot] commented 1 week ago

Would you be able to provide a reproduction? 🙏

More info ### Why do I need to provide a reproduction? Reproductions make it possible for us to triage and fix issues quickly with a relatively small team. It helps us discover the source of the problem, and also can reveal assumptions you or we might be making. ### What will happen? If you've provided a reproduction, we'll remove the label and try to reproduce the issue. If we can, we'll mark it as a bug and prioritise it based on its severity and how many people we think it might affect. If `needs reproduction` labeled issues don't receive any substantial activity (e.g., new comments featuring a reproduction link), we'll close them. That's not because we don't care! At any point, feel free to comment with a reproduction and we'll reopen it. ### How can I create a reproduction? We have a couple of templates for starting with a minimal reproduction: 👉 [Reproduction starter (v8 and higher)](https://stackblitz.com/fork/github/BobbieGoede/nuxt-i18n-starter/tree/v8) 👉 [Reproduction starter (edge)](https://stackblitz.com/fork/github/BobbieGoede/nuxt-i18n-starter/tree/edge) A public GitHub repository is also perfect. 👌 Please ensure that the reproduction is as **minimal** as possible. See more details [in our guide](https://nuxt.com/docs/community/reporting-bugs/#create-a-minimal-reproduction). You might also find these other articles interesting and/or helpful: - [The Importance of Reproductions](https://antfu.me/posts/why-reproductions-are-required) - [How to Generate a Minimal, Complete, and Verifiable Example](https://stackoverflow.com/help/mcve)