Closed mhuretski closed 4 months ago
@mhuretski Thank you for this detailed issue and for providing the reproduction!
The problem is the basePath
: the default value is ./
(https://github.com/robisim74/qwik-speak/blob/main/docs/inline.md#configure), while in your nx repo it is ./apps/test
. Therefore you should update the qwikSpeakInline
settings like this:
qwikSpeakInline({
supportedLangs: ['en-US', 'it-IT'],
defaultLang: 'en-US',
assetsPath: 'i18n',
basePath: './apps/test'
}),
Let me know.
Oh, I see, yes, it makes perfect sense, basePath
is relative to the root of the project and package has apps/test
path.
Thank you very much for the help!
Hi,
I'm having a nx monorepo and have a problem with i18n locally. SSR serves correct values, then they are changed to default values on client. Basically whenever component is hydrated, js files are requested from server and content is always with default values.
I've created empty nx monorepo project with
npx create-nx-workspace@latest org-workspace --preset=qwik-nx
and added qwik-speak. Here's empty repo that reproduces the issue https://github.com/mhuretski/nx-qwik-issue-repr.Steps:
pnpm install && npx nx run test:serve
it's value is going to change from "LOCALIZED ALERT" (IT locale value) to "Alert" (default value). This issue is not reproducable with normal project without monorepo.
Issue only affects local development, the values are correct in prod mode. So it's something I can live with but it's quite annoying one to have. I've tried to play around with
outDir: '../../dist/apps/test'
inqwikSpeakInline
options but it didn't help. Could you take a look?