Search code examples
javascriptvue.jsnuxt.jsnuxt-i18n

Nuxt.js: message: 'This page could not be found' (nuxt-i18n)


In my Nuxt.js application, I installed the nuxt-i18n according to how the documentation suggests:

{
  modules: [
    ['nuxt-i18n', {
      // Options
    }]
  ]
}

But when I run npm run dev, I get this error message:

 DONE  Compiled successfully in -4519ms                                12:53:52                                                                                         


 OPEN  http://localhost:3000                                                                                                                                            

  nuxt:render Rendering url / +0ms                                                                                                                                      
{ statusCode: 404,                                                                                                                                                      
  path: '/',                                                                                                                                                            
  message: 'This page could not be found' }  

How to fix this?


Solution

  • it works fine if you set a default locale :)

      modules: [
        ['nuxt-i18n', {
          locales: ['en', 'fr', 'es'],
          defaultLocale: 'en',
          seo: false // workaround to fix the current issue on module https://github.com/nuxt-community/nuxt-i18n/issues/127
        }]
      ],