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.

Lazy Load json files after generating static files

See original GitHub issue

Hello!

I was trying around a bit if I can use this plugin for my next project. It is awsome by the way. Could set up routing and translation in about 40 minutes! yay!

But I found one issue. When using “npm run generate” to generate static files - the first page load does not show the translations! If I change the language it starts working. It seems that on inital load the json language file is not working. Does anybody have any clue how i can solve that?

I made a git repo here https://github.com/elpeyotl/nuxt-translation. attached a screenshot of the behaviour.

Well it is only not working when generating static pages. In npn run dev it is working.

nuxt

my config module.exports = { modules: [ ['nuxt-i18n', { locales: [ { code: 'en', iso: 'en-US', name: 'English', langFile: 'en-US.json' }, { code: 'fr', iso: 'fr-FR', name: 'Français', langFile: 'fr-FR.json' }, { code: 'de', iso: 'de-DE', name: 'Deutsch', langFile: 'de-DE.json' } ], loadLanguagesAsync: true, langDir: 'lang/', defaultLocale: 'en', // ... }] ] }

<div align="right">This bug report is available on Nuxt.js community (#c24)</div>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
manniLcommented, Feb 25, 2018

Looks like the bug is fixed. Thank you, Paul! But there is another (rare) edge case. Will open up a new issue for it in a second

2reactions
paulgvcommented, Feb 25, 2018

Hi guys, sorry for this frustrating issue. Hopefully it’s fixed in v2.3.4. @elpeyotl thanks for the repo, I tested it with the new version and it looks okay!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lazy Load json files after generating static files #31 - GitHub
Hello! I was trying around a bit if I can use this plugin for my next project. It is awsome by the way....
Read more >
How to lazy load static JSON in angular application
I placed some JSON files in asset folder. In my HTML i put a button, on clicking which some attributes of this JSON...
Read more >
How and when (not) to use webpack for lazy loading? - Medium
You can load only the files you want and improve your app's performance. ... file is lazy loaded only after the form is...
Read more >
How To Handle Async Data Loading, Lazy Loading, and Code ...
Suspense is a built-in component you use to display a fallback message while the code is loading. Save the file.
Read more >
Lazy Loading | webpack
Lazy, or "on demand", loading is a great way to optimize your site or application. This practice essentially involves splitting your code at...
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