nuxt meta robots set to noindex when in production mode

3.5k Views Asked by At

I don't understand why my app has meta robots set to noindex when I'm in production mode only ?? Here is my nuxt.config

import i18n from './config/i18n'
export default {
  head: {
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' },
     { hid: 'robots', name: 'robots', content: 'index, follow' }
    ],
  },
  buildModules: ['nuxt-lazysizes',
    [
    'nuxt-i18n',
    {
      strategy: 'prefix_except_default',
      defaultLocale: 'en',
      seo: true,
      baseUrl: envBaseUrl,
      locales: [
        {
          code: 'en',
          name: 'English',
          iso: 'en-GB'
        },
        {
          code: 'fr',
          name: 'Français',
          iso: 'fr-FR'
        }
      ],
      vueI18n: i18n
    }
    ]
  ],
  env: {
    baseUrl: envBaseUrlAdmin
  },
}

I even set the meta in the layout /default.vue just in case, but still the same. This is driving me insane !! It's perfectly fine in dev mode. Why would any one want production with no index and dev or staging with it ? This is absurd.

head () {
        return {
          meta: [{ hid: 'robots', name: 'robots', content: 'index, follow' }],
        }
    }
1

There are 1 best solutions below

2
On

Ok, it was a conflict with my Yoast plugin. Haven't found why it was only doing this in prod, and not in dev, but it's fine now. Sorry for the dumb question.