Next-i18next: Can't find i18n folder when deploying via @zeit/Now

Created on 17 Aug 2019  路  14Comments  路  Source: isaachinman/next-i18next

Describe the bug

Tried to deploy examples/simple to now but failed to run.

Occurs in next-i18next version

V1.0.0

Steps to reproduce

  • clone examples/simple
  • deploy to now
  • 502: BAD_GATEWAY

Expected behaviour

it should run successfully on now platform

Screenshots

ERROR   Uncaught Exception  {"errorType":"Error","errorMessage":"ENOENT: no such file or directory, scandir '/var/task/static/locales/en'","code":"ENOENT","stack":["Error: ENOENT: no such file or directory, scandir '/var/task/static/locales/en'","    at Object.readdirSync (fs.js:790:3)","    at getAllNamespaces (/var/task/page.js:14724:19)","    at _default (/var/task/page.js:14729:27)","    at new NextI18Next (/var/task/page.js:17983:46)","    at Object.k7Sn (/var/task/page.js:14791:18)","    at __webpack_require__ (/var/task/page.js:23:31)","    at Module.Y0NT (/var/task/page.js:9811:63)","    at __webpack_require__ (/var/task/page.js:23:31)","    at Module.f8ve (/var/task/page.js:11600:85)","    at __webpack_require__ (/var/task/page.js:23:31)"],"errno":-2,"syscall":"scandir","path":"/var/task/static/locales/en"}
END RequestId: ba58e4b2-1a15-46d6-9693-00b1206c6973
REPORT RequestId: ba58e4b2-1a15-46d6-9693-00b1206c6973  

Screenshot 2019-08-17 at 19 18 04

Screenshot 2019-08-17 at 19 18 39

All 14 comments

Duplicate of #274.

I've got the same problem

@DutchPrince I do not have knowledge about now the now platform abstracts filesystems. I would welcome any PRs. Alternatively, you can consume your localisation content via network requests with any number of i18next plugins.

@DutchPrince I do not have knowledge about now the now platform abstracts filesystems. I would welcome any PRs. Alternatively, you can consume your localisation content via network requests with any number of i18next plugins.

Thanks for your response!

What does PRs mean?

What does PRs mean?

Pull requests. This is open source software and relies upon contributions from the community.

Excuse me guys I probably have searched for every thread that is related to this but I can't find a way to tell the server what is the path to the locales... I didn't find anything helping me in the said duplicate #274.

I am also using vercel, did anyone manage to make it work with next-i18next ?

My locales are located in public/static/locales

But when I deploy I got this path as not found

/var/task/public/static/locales/en'

I noticed that once deployed the structure on vercel has no public/

Capture d鈥檈虂cran 2020-07-07 a虁 16 25 30

I know that "/public/static/locales" is the default i18n path, so I tried to change it to /static/locales so it will fit the vercel structure.

So I set localePath to "static/locales"

Then is does not deploy anymore and I got this as a path not found...

*/vercel/7d248d1f/static/locales/en'*

I tried also the backEnd config option without success...

I am out of idea. Help :'(
Thank you guys.

@Chill-Studio This issue needs to be resolved by the Vercel team, and they're aware of it: https://github.com/vercel/next.js/issues/13624

Wo that's a fast answer thank you !

Arg I can see there is not workaround :(

At the moment, the best "workaround" is to use a different serverless platform.

Is there any other platforms recommend?

@limebear The issue has been resolved. Vercel is probably your best option.

Excuse me guys I probably have searched for every thread that is related to this but I can't find a way to tell the server what is the path to the locales... I didn't find anything helping me in the said duplicate #274.

I am also using vercel, did anyone manage to make it work with next-i18next ?

My locales are located in public/static/locales

But when I deploy I got this path as not found

/var/task/public/static/locales/en'

I noticed that once deployed the structure on vercel has no public/

Capture d鈥檈虂cran 2020-07-07 a虁 16 25 30

I know that "/public/static/locales" is the default i18n path, so I tried to change it to /static/locales so it will fit the vercel structure.

So I set localePath to "static/locales"

Then is does not deploy anymore and I got this as a path not found...

*/vercel/7d248d1f/static/locales/en'*

I tried also the backEnd config option without success...

I am out of idea. Help :'(
Thank you guys.

@Chill-Studio did you found how to resolve this error? Can you help me please?

@anialamo Check this repo. It's deployed on Vercel here. Good luck!

Thanks for this!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MichaelIT picture MichaelIT  路  4Comments

revskill10 picture revskill10  路  5Comments

nataliaroque77 picture nataliaroque77  路  3Comments

romaincointepas picture romaincointepas  路  6Comments

HectorLS picture HectorLS  路  6Comments