-
-
Notifications
You must be signed in to change notification settings - Fork 763
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
Webpack 5 support #879
Comments
Hey @gurkerl83, we're no longer importing Can you let me know if you have any issues using webpack v5 on next-i18next v8? |
@isaachinman I no longer use next-i18next, sry! |
No problem. What are you using these days? |
@isaachinman I migrated my project to next-translate, https://github.com/vinissimus/next-translate/issues. |
The current version of next-i18next (7.0.1) and its predecessors are not compatible with Webpack 5.
In the context of a Webpack based application development, two operating variants are distinguished, development and production.
When executing a build in the development profile, Webpack does not perform any optimisations, the build is successful.
In the production profile, Webpack applies advanced tweaking to reduce package sizes to a minimum. The static analysis used by Webpack identifies accessible paths to imported modules that are required by an application. The analysis takes into account dependencies not only of the first degree. Dependencies which themselves use other libraries as dependencies (transitive dependencies) become a problem in complex dependency chains.
First of all the error message during the execution in the production profile.
The dependency graph of next-i18next
next-i18next -> i18next-fs-backend -> js-yaml
In the module i18next-fs-backend artefacts are copied to the used library js-yaml and stored in the formats directory, initiated via an NPM script.
https://github.com/i18next/i18next-fs-backend/blob/569ce6c99c24e8ae4f82b47b164c6e74686b6b01/package.json#L63
Positions at which the problem is possibly caused.
In any case, the library i18next-fs-backend is imported into next-i18next as follows As the cause of the problem this can probably be excluded.
https://github.com/isaachinman/next-i18next/blob/01069e39a1c55e5df88de852c65198eb611abc09/src/create-client/browser.ts#L2
The error is probably not related to NextJs, older and newer versions were tested.
In summary it can be said that the problem and the above mentioned error output is probably not a bug in next-i18next itself, but is caused either by i18next-fs-backend or by js-yaml.
The next step would be to clarify on which level the problem occurs. This requires direct imports from i18next-fs-backend or js-yam.
Thx!
The text was updated successfully, but these errors were encountered: