TypeError: Cannot read properties of undefined (reading 'currentLang')

Hello, I did exactly same multilingual next js example on prismic. Only extra using nextjs slice machine. Main language flag is rendering but not the other language is rendering. Also when I click the forwarding me to second language too. Only language switcher is not working. But I have an issue with currentLang. TypeError: Cannot read properties of undefined (reading 'currentLang').

Do you know what can be caused this issue?

Hi, @flashnukers,

Thanks for reaching out.

Have you checked this document about Multilingulat Templating in Next.js? There is, in fact, a section specific to its implementation in Slice Machine.

To be honest, I don't know the cause of the error you are getting, but I can't try to debug this issue with you if you can share some code snippets as well as your repository name (in a private message if necessary)

Looking forward to your reply,