-
-
Notifications
You must be signed in to change notification settings - Fork 39
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.js: next-i18next incompatibility #206
Comments
There are several NextJS related issues that are making pigment unsable for now. Unluckily. |
@rkurbatov Yeah, I've been hitting many walls with pigment over the past few weeks. I really want to push ahead with it for my latest project because of code style familiarity, but there's such a wide variety of nasty issues. (The EISDIR one I posted, particularly. Have you not encountered this one?) |
@rhoiyds the problem is our project is pretty big and pretty old. We are using emotion everywhere but NextJS 13+ doesn't support it so we were searching for a good CSS library that allows simple conversion. The problem is I need to update multiple pacakages at once on a big codebase. And I cannot migrate styles partially. That works on a minimal projects but once I add something new - it fails due to incompatibilty. And when I resolve issue on the main project - there is another one that I have to find (as it fails silently quite often), fix on small repo and the fix on the main repo. And because pigment is still inmature and has way many issues with nextjs especially (that is known for its import joggling) I am afraid we have to search for something else. |
Feeling your pain and frustration. If this is the V6 direction for material-ui, then I am seriously considering other options as I am finding issue after issue with pigment making the DX super frustrating... |
Steps to reproduce
Either pigment or next-i18next i18n library can work on a project:
https://github.com/rkurbatov/acq-test - here is example repository for NextJS v12. We managed to fix next-i18next import problem I created earlier (#115 - author provided the fixed version) but here we have the new one, that looks totally unrelated on first sight.
Current behavior
https://github.com/rkurbatov/acq-test/blob/master/pages/_error.tsx - watch this file. Once you try to uncomment the code and import the Image component the build fails complaining on problems with the import of the next/image component (something __esModule related):
The problem goes away if you comment either
css()
function call and related code oruseTranslation()
hook usage.If you try NextJS version 13 it doesn't work even with the commented page complaining on something totally unrelated:
Disabling either
css()
function oruseTranslate()
hook helps as also.I really don't understand how import of the translation hooks ruins things but it does, probably that's related to the way pigment transpiles the source code. For now that stops us from the usage of the pigment library that looks like the best alternative to emotion we use currently.
Expected behavior
No response
Context
No response
Your environment
npx @mui/envinfo
Search keywords: NextJS next-i18next
The text was updated successfully, but these errors were encountered: