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

Next export is broken with v6.0.0 #780

Closed
clement-faure opened this issue Jul 30, 2020 · 11 comments · Fixed by #781
Closed

Next export is broken with v6.0.0 #780

clement-faure opened this issue Jul 30, 2020 · 11 comments · Fixed by #781

Comments

@clement-faure
Copy link

clement-faure commented Jul 30, 2020

Describe the bug

Trying to next export the application using latest version of next-i18next (v6.0.0)

Occurs in next-i18next version

"next-i18next": "^6.0.0"

Steps to reproduce

clement-faure/next-antd-graphql-starter@c2b8f0b

Git clone next-antd-graphql-starter and run next export

Screenshots

image

OS

  • Device: MBP 2019 16"
@isaachinman
Copy link
Contributor

Next export is not something this package can easily support. If you want fully static websites, you're better off rolling dynamic directories on your own.

If you'd like to investigate and contribute though, you are more than welcome!

@clement-faure
Copy link
Author

Thank you for the quick response @isaachinman !

@isaachinman
Copy link
Contributor

No problem. Bit more context: next export apps represent a pretty small proportion of NextJs apps – most are hybrid apps. On top of that, certain data fetching methods (including getServerSideProps, etc) are incompatible with next export. There are no plans to support next export.

We managed to make it work (result was client side only app) in the past, but even that was not a very good idea – you may as well use CRA with react-i18next, or something.

I'll remove that line from the docs.

@eric-burel
Copy link
Contributor

eric-burel commented Jul 30, 2020

Ha @clement-faure great minds think alike.

@isaachinman You might want to take a look at this issue I've just opened vercel/next.js#15674

next export might be a minor usage in proportion, but not necessarily small usage at all. I hope that in the future getServerSideProps becomes available again with next export, by just being ignored.
Can you maybe reopen this issue to keep the discussion open?

@isaachinman
Copy link
Contributor

@eric-burel I thought that Tim was quite clear about the incompatibility?

@eric-burel
Copy link
Contributor

eric-burel commented Jul 30, 2020

Do you have more reference o nthis ? Those feature are incompatible, but no need to drop the support of next export altogether, getServerSideProps can just be ignored during next export.

Supporting both is really a great value to us, and that for non trivial applications.
Note that I get that the solution is probably not at next-i18nnext level.

@isaachinman
Copy link
Contributor

Fairly soon, next-i18next will support static/SSG outputs from next build. I don't have any plans to put effort into supporting next export, but if anyone wants to lead that effort, I can certainly reopen this issue and answer any questions they may have.

@eric-burel
Copy link
Contributor

Technically if it works for next static build on your side, it should work with next export with no additional work, provided getServerSideProps is left compatible with next export. So yeah, the solution is most probably on Next side, will wait for their answer.
First step is to make my case in favour of supporting both next export and dynamic server side rendering in the same codebase ^^

@isaachinman
Copy link
Contributor

provided getServerSideProps is left compatible with next export [...] next export and dynamic server side rendering in the same codebase

I don't foresee either of those things happening. But again, happy to reopen if someone else wants to lead the implementation.

@yingqi-chen
Copy link

No problem. Bit more context: next export apps represent a pretty small proportion of NextJs apps – most are hybrid apps. On top of that, certain data fetching methods (including getServerSideProps, etc) are incompatible with next export. There are no plans to support next export.

We managed to make it work (result was client side only app) in the past, but even that was not a very good idea – you may as well use CRA with react-i18next, or something.

I'll remove that line from the docs.

Can you explain what CRA in react-i18next is? Thanks!

@idrisakmal
Copy link

Can you explain what CRA in react-i18next is? Thanks!

Basically he's saying just use create-react-app with any i18n package

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

Successfully merging a pull request may close this issue.

5 participants