question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error parsing "nuxtI18n" component option in file

See original GitHub issue

Version

nuxt: 2.14.7 nuxt-i18n: 6.15.3

nuxt.config.js

{
 buildModules: [
    '@nuxt/typescript-build',
    '@nuxtjs/vuetify',
    ['nuxt-i18n', {
      lazy: true,
      langDir: 'lang/',
      defaultLocale: 'ru',
      locales: [
        { code: 'ru', file: 'ru.ts' },
        { code: 'en', file: 'en.ts' }
      ]
    }]
  ]
}

At the beginning of the assembly, it issues such warnings, and not on all pages.

image

Could this cause problems?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:20

github_iconTop GitHub Comments

2reactions
belvederefcommented, Jun 9, 2021

Still experiencing this issue. In my case, it happens if I use any external variable/import in the nuxtI18n component options. E.g. this works:

@Component({
  nuxtI18n: {
    locales: ['en'],
  },
})

while the code below triggers the error and does not let nuxtI18n apply the in-component options for the page.

const myLocales = ['en'];

@Component({
  nuxtI18n: {
    locales: myLocales,
  },
})

I was not able to overcome this issue, it’s a huge blocker

Edit: This issue is nastier than I thought. I get the issue even if I try to specify some TS typings. E.g.:

@Component({
  nuxtI18n: {
    locales: ['en'] as Array<string>,
  },
})
1reaction
Luferovcommented, Jun 28, 2022

Thank you @Luferov for the reply. I’m running a Vue2 application, its possible to implement your suggestion with a plugin like this Composition API plugin for Vue 2 ?

If possible, would you mind providing us an example? Thank you again in advance!

Of course, no problem. We are writing an application and it is open source. We are currently transitioning to nuxt3 and therefore are now in the nuxt-bridge version. For example, https://github.com/devind-team/dcis/tree/main/client.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error parsing "nuxtI18n" component option in file #933 - GitHub
My component. When I delete get bc() , warning disappears. Perhaps, component style is bad way... <template ...
Read more >
Why nuxt-i18n module doesn't seem to be loaded? ( _vm.$t is ...
I removed node_modules and .nuxt folder, reissue a yarn install but I still have this error, _vm.$t is not a function . Where...
Read more >
A simple multi-language site with Nuxt.js and nuxt-i18n
Setting the parameters inside our configuration options in the nuxt.config.js file or inside each of our pages. If we choose the first method...
Read more >
nuxt-i18n | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
I18n Module - Nuxt
Custom routes optimized for Nuxt 3 file based routing - by @kazupon in ... don't crash on missing route when parsing page component...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found