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

Hydration completed but contains mismatches #193

Open
TohidMth opened this issue Dec 1, 2024 · 0 comments
Open

Hydration completed but contains mismatches #193

TohidMth opened this issue Dec 1, 2024 · 0 comments

Comments

@TohidMth
Copy link

TohidMth commented Dec 1, 2024

hi

When using this plugin in inertia
There is a hydration problem in SSR mode

In the following case
ssr.ts

.use(i18nVue, {
    lang: "fa",
    resolve: (lang) => {
        const langs = import.meta.glob("../../lang/*.json", { eager: true });
        return (langs[`../../lang/${lang}.json`] as any).default;
    },
})

Error: Hydration completed but contains mismatches

And in the following case
ssr.ts

.use(i18nVue, {
    resolve: (lang) => {
        const langs = import.meta.glob("../../lang/*.json", { eager: true });
        return (langs[`../../lang/${lang}.json`] as any).default;
    },
})

The hydrated problem is solved. But the texts in the page source are not translated. and are displayed as follows:
messages.example ...

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