Skip to content

Hydration completed but contains mismatches #193

@TohidMth

Description

@TohidMth

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 ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions