Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using dev (vite dev), every other page refresh.. $isLoading doesn't update from true to false #16

Open
warren-bank opened this issue Apr 19, 2024 · 0 comments

Comments

@warren-bank
Copy link

I found a workaround that seems to work OK..
just thought I'd drop a note, in case anyone wants to dig deeper and find a better fix.

The issue started when:

  • I added a 2nd namespace, with a JSON object having about 1000 keys

After doing so, any +page.svelte containing:

<pre>$isLoading = {$isLoading} ({typeof $isLoading})</pre>

{#if $isLoading === false}
  OK!
{/if}

..would finish loading about 50% to 70% of the time

My workaround was to modify how I initialize the libraries in my root layout:

import i18next from 'i18next'
import {createI18nStore, isLoading} from 'svelte-i18next'

i18next
  .init(
    {...},
    (error) => {
      isLoading.set(!!error)
    }
  )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant