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

Ability to Disable SEO Features Without Warnings #3186

Open
MariaAndreyeva opened this issue Oct 21, 2024 · 0 comments
Open

Ability to Disable SEO Features Without Warnings #3186

MariaAndreyeva opened this issue Oct 21, 2024 · 0 comments

Comments

@MariaAndreyeva
Copy link

Hello,

I am using the Nuxt i18n module in my project and I have come across an issue regarding SEO features. According to the documentation, to leverage SEO benefits, the locales option must be configured as an array of objects with each object having a language option set to the locale language tags: SEO Requirements Documentation.

However, I do not intend to use the SEO benefits such as hreflang alternate link generation and canonical link generation. Therefore, I have removed the language options from my configuration. Despite this, I still receive the following warning in the console:

WARN  Locale language ISO code is required to generate alternate link

Expected Behavior:

I would expect that if SEO features are not needed or explicitly disabled, there should be no warnings related to SEO in the console.

Actual Behavior:

Even after removing language options, I still receive warnings in the console related to SEO features.

Steps to Reproduce:

  1. Configure the locales option without language in the Nuxt i18n module.
  2. Run the application.
  3. Observe the warning in the console.

Example Configuration:

// nuxt.config.js
export default {
  modules: [
    '@nuxtjs/i18n',
  ],
  i18n: {
    locales: [
      { code: 'en', name: 'EN' },
      { code: 'fr', name: 'FR' }
    ],
    defaultLocale: 'en',
    lazy: true,
    langDir: './lang',
    strategy: 'prefix',
    // enables localised routes
    customRoutes: 'config',
    pages: LocalisedRoutes,
    // adds `vueI18n` option to `@nuxtjs/i18n` module options
    vueI18n: 'vue-i18n.config.ts',
  }
}

Console Warning:

WARN  Locale language ISO code is required to generate alternate link

Environment Information:

Nuxt Version: 3.13.2
Nuxt i18n Module Version: 8.5.5
Node.js Version: 20.10.0
Operating System: macOS

Feature Request:

Is it possible to provide a way to completely disable SEO features, including the suppression of any related warnings, when they are not needed? This would help in keeping the console clean and avoid any unnecessary warnings.

Thank you for considering this request. I appreciate the work that has gone into this module and look forward to any updates or guidance on this matter.

Best regards,
Maria

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

1 participant