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.

Infinite reload for nuxt static "nuxt-i18n": "^6.20.2",

See original GitHub issue

When changed the target to static and ssr to true, started a infinite reload of any page of the website. If I remove defaultLocale: en the pages stops to reload but translations are not working. Is this a problem with il8n or with my routes?

   my config:
   i18n: {
 parsePages: false,
 locales: [
   {
     code: 'en',
     iso: 'en-GB',
     name: 'english',
     file: 'en.js',
   },
   {
     code: 'ro',
     iso: 'ro-RO',
     name: 'romanian',
     file: 'ro.js',
   },
 ],
 defaultLocale: 'en',
 vueI18n: {
   fallbackLocale: 'ro',
   messages: {
     ro: require('./lang/ro').default,
     en: require('./lang/en').default,
   },
 },
 lazy: true,
 langDir: 'lang/',
},

My router:


    routes: [
      {
        path: '/',
        component: Index
      },
      {
        path: '/information/terms-and-service',
        component: Terms
      },
      {
        path: '/information/privacy-policy',
        component: Privacy
      },
      {
        path: '/information/refund-policy',
        component: Refund
      },
      {
        path: '/collections/:slug',
        component: CollectionItems,
      },
      {
        path: '/en/collections/:slug',
        component: CollectionItems,
      },
    ]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12

github_iconTop GitHub Comments

2reactions
rchlcommented, Feb 23, 2021

This can depend on where you deploy or how you start the static server so it’s hard to help without knowing exactly what you are doing.

But my guess would be that it has something to do with trailing slashes.

You could try setting router { trailingSlash: true } in nuxt.config.js.

0reactions
skourtacommented, Aug 21, 2021

Nope not yet. I faced the problem while workin on my company’s website. I could apply the workaround with the router { trailingSlash: true }. I will try to make a reproducible repo on my free time.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Infinite reload for nuxt static "nuxt-i18n": "^6.20.2", · Issue #1074
I have an identic page /tags and tags are working fine. Looks like the module is changing the language continuously itself.
Read more >
Static Site Generation - Nuxt
With static site generation you can render your application during the build phase and deploy it to any static hosting services such as...
Read more >
Migrating Nuxt to 2.7: refresh loop - Stack Overflow
I'm working on migrating a Nuxt.js project from Nuxt@1.4 to 2.7 , and after updating the Webpack config as required, etc.
Read more >
Manage static content with Prismic.io and Nuxt.js - Bitbull
While looking for a service to hold static contents on an headless e-commerce project we are building, we chose Prismic.io after a couple...
Read more >
Nuxt SSR page reload on a dynamic page - Reddit
Can u share ur nuxt config? Otherwise have you checked the generate property? In static mode it's recommanded to set fallback to true,...
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