nakorndev
nakorndev

Reputation: 919

Got message from console "Duplicate names route"

I using with nuxt.js and nuxt-i18n to use locales.

But I always got this message on console by duplicate that even I using nuxt generate from folder structure.

Message:

enter image description here

Routing:

enter image description here

Sample of config:

modules: [
    '@nuxtjs/axios',
    ['nuxt-i18n', {
      locales: [
        { name: 'ภาษาไทย', code: 'th', iso: 'th-TH', file: 'th.js' },
        { name: 'English', code: 'th', iso: 'en-US', file: 'en.js' }
      ],
      defaultLocale: 'th',
      lazy: true,
      langDir: 'lang/'
    }]
  ],

Please help. Thanks.

Upvotes: 0

Views: 867

Answers (1)

Aldarund
Aldarund

Reputation: 17621

You have same code for both of your locales.

code: 'th'

Change english code to en and it should fix the issue

Upvotes: 1

Related Questions