Next-i18next: Error with getServerSideProps and next-i18next@^8.0.0-beta.2

Created on 25 Jan 2021  Â·  12Comments  Â·  Source: isaachinman/next-i18next

Describe the bug

Error 502 in vercel, when using getServerSideProps with next-i18next@^8.0.0-beta.2

Occurs in next-i18next version

next-i18next@^8.0.0-beta.2

Steps to reproduce

Create dynamic page with next-i18next and getServerSideProps

Screenshots

image
image

OS

  • Browser: Chrome 87.0.4280.141

Most helpful comment

image

All 12 comments

@Achaak The error seems pretty straightforward – the /public/static/locales/fr dir is missing. For reference, this repo is deployed on Vercel without any issues. Let me know if you still feel as though there's a bug here.

This is precisely the problem.
The file /public/static/locales/fr exists.
The other static pages work very well.

Do you have a reproducible repo?

I am encountering the same problem using Incremental Static Regeneration and deploying on Vercel. Version 8.0.0-beta.4

This looks to me like a transient filesystem issue which is probably pretty specific to Vercel. @Achaak or @destruc7i0n can you open a support ticket with Vercel and ask them why these files are available during SSG but not during SSR?

image

Not sure how you phrased the support ticket, but you'll need to make it clear this is a _filesystem_ issue, and is not specifically related to third-party packages.

Yes, maybe we could try again but I've said exactly this:

Hello, there is a potential transient filesystem issue during SSG but not during SSR

https://github.com/isaachinman/next-i18next/issues/919

I was able to resolve this by placing the following call above the usage of serverSideTranslations in my getStaticPaths.

path.resolve('./public/locales')

Usage in my code

They appear to be using vercel/nft to see which files to include in the serverless runtime.

Yep, that makes sense, and that is why path.resolve is in the docs for the current v7 version.

I have test but with next-i18next-config.js or path.resolve (in getServerSideProps) and not work for me.

Version: next-i18next@^8.0.0-beta.4

Check my repo :
Repo: https://github.com/Achaak/next-i18next-issue
Page work: https://next-i18next-issue.vercel.app/fr
Page not work: https://next-i18next-issue.vercel.app/fr/123

image

Was this page helpful?
0 / 5 - 0 ratings