Provide the possibility to include json files inside /public/static/locales/ folder in the vercel lambda
See original GitHub issueFeature request
Is your feature request related to a problem? Please describe.
When deploying a next-i18next translated project to vercel, the serverless lambda doesn’t include the .json translation files located under public/static/locales.
Thus, following error arises every time when deploying to vercel:
The creator of next-i18next recommended to reach out to the vercel team. A user then created a issue dedicated to this on the vercel repo . Here, @paulogdm noted that this is due to a known next.js framework limitation, captured in [vercel/next.js#8251].
Unfortunately, there’s no real solution or workaround for this problem yet. I opened a new issue for this to give this problem more attention, because no user of next-i18next is able to deploy to vercel because of this framework limitation.
Describe the solution you’d like
- somehow configure that vercel should include all files inside
public/static/locales
in the serverless lambda
Describe alternatives you’ve considered
I tried to manually import the language files as suggested here, but the containing folder is still not detected (the error stays the same)
Additional context
Folder structure:
Issue Analytics
- State:
- Created 3 years ago
- Reactions:16
- Comments:10 (4 by maintainers)
Top GitHub Comments
I’ve just done a deep inspection of the code and there is nothing that explicitly tells Next.js that you’d be looking for files in that directory. This seems to be an implicit dependency of the library.
This is an intended design detail!
Adding the following lines will fix the files being missing:
path.resolve
is the necessary code here!Ran into the exact problem today and found this open issue. Sounds like deploying i18n-enabled solutions to Vercel is not an option until this problem is resolved.