martinkr/next-export-i18n

When I try building my next.js project using 'yarn build':

mr-ezak opened this issue · 2 comments

Everytime I try building using the 'Yarn build' command I get the Following Error for some of my pages:
TypeError: Cannot read properties of undefined (reading 'split')
Screen Shot 2023-04-29 at 12 59 27 AM

Hi @mr-ezak,

Thank you for reaching out. I'm trying to understand your issue: are you trying to run yarn build for this repository or your project?

Cheers!

Tnx a lot for answering, I was trying to use "yarn build" in my own project but I keep receiving errors for using the "t" function :

import { useTranslation } from 'next-export-i18n' const {t} = useTranslation()

But then I realized that I was using the "t" function multiple times and nested which is wrong, So when I used it properly problem got solved, and "yarn build" worked perfectly.

Thanks again for such an amazing package, Keep up the good work.🫡