Skip to content
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

Error with getServerSideProps and next-i18next@^8.0.0-beta.2 #919

Closed
Achaak opened this issue Jan 25, 2021 · 14 comments
Closed

Error with getServerSideProps and next-i18next@^8.0.0-beta.2 #919

Achaak opened this issue Jan 25, 2021 · 14 comments

Comments

@Achaak
Copy link

Achaak commented Jan 25, 2021

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
@isaachinman
Copy link
Contributor

@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.

@Achaak
Copy link
Author

Achaak commented Jan 25, 2021

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

@isaachinman
Copy link
Contributor

Do you have a reproducible repo?

@Achaak
Copy link
Author

Achaak commented Jan 25, 2021

@destruc7i0n
Copy link

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

@isaachinman
Copy link
Contributor

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?

@yovanoc yovanoc mentioned this issue Feb 5, 2021
@yovanoc
Copy link

yovanoc commented Feb 5, 2021

image

@isaachinman
Copy link
Contributor

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.

@yovanoc
Copy link

yovanoc commented Feb 5, 2021

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

@destruc7i0n
Copy link

destruc7i0n commented Feb 5, 2021

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.

@isaachinman
Copy link
Contributor

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

@Achaak
Copy link
Author

Achaak commented Feb 8, 2021

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

@dalalRohit
Copy link

Did anybody got the solution?

Facing the same when using SSR, works well with SSG

@ASgmbv
Copy link

ASgmbv commented Sep 5, 2021

Did anybody got the solution?

Facing the same when using SSR, works well with SSG

module.exports = {
i18n: {
defaultLocale: 'en',
locales: ['en', 'de'],
},
localePath: path.resolve('./my/custom/path'), // add this line in next-i18next.config.js file
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants