-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Issues with using allowMultiLoading #114
Comments
compare with this example: https://github.com/i18next/i18next-multiload-backend-adapter/tree/master/example |
Thank you for the response. Unfortunatley i cant fully replicate that since the project is configured a bit different, but tried and failed. |
No. |
So what should i try to make the allowMultiLoading to work? |
like said compare your setup with this one: https://github.com/i18next/i18next-multiload-backend-adapter/tree/master/example
|
Thank you , but now i realise that that example is implemented in express, and for some reason when i try to use the MultiLoadBackendAdapter plugin in my NextJS configs it errors out with : Module not found: ESM packages (i18next-multiload-backend-adapter) need to be imported. Use 'import' to reference the package instead. https://nextjs.org/docs/messages/import-esm-externals Even if i import it with the import keyword |
For Next.js to import like this:
|
Unfortunatley even if i tried that using the required keyword or inport, still i get: Module not found: ESM packages (i18next-multiload-backend-adapter/cjs) need to be imported. Use 'import' to reference the package instead. https://nextjs.org/docs/messages/import-esm-externals |
and else, please create a minimal reproducible example github repo |
So i made this sample project, by default it makes a req per namespace and i cant find any way to reduce that to 1 req: |
here the proposed fix: https://github.com/bfgelectronics/next-test-i18n/pull/1 |
Thank you soo much, but unfortunatley for some reason the FE doesnt make any requests to the backend (at least none that i can see ). |
in next.js it is server side first, that's why you don't see any request from the client by default |
btw. Why you don't use the official i18next tms (locize.com) that supports the future of i18next? |
Thank you ! I agree with the fact that server side is first but i put a console log on the api endpoint an i see no requests. Sincerley Locize looks better than localazy in terms of features and ill use it in future projects but unfortunatley on the current project i have no power of chosing. |
You see no requests, because for the server side rendered pages it will not do any request, it will just load the translations from the file system. |
Sorry for deviating from the initial Issue, but added the MultiloadAdapter and it groups the namespaces but only in 10 pairs, (so in my case there are 30 namespaces) is there any proprety that adjust the namespace count per search? |
Try to set maxParallelReads to 30 in the i18next init options |
Finnaly it works, thank you! |
🐛 Bug Report
I cant get to get the allowMultiLoading to work.
My issue is that i have all the namespaces on a single file on the CDN but the http backends make a request for every namespace i have , so i would like to group the namespaces in a way that would allow only one request to be made (as the cdn returns all the namespaces on every request).
To Reproduce
The backend options used
Expected behavior
The http backend should group the namespaces.
Your Environment
The text was updated successfully, but these errors were encountered: