Issue with URL Escaping during Next.js Build for Non-Latin Characters #49968
Unanswered
akayavanade
asked this question in
Help
Replies: 1 comment
-
@akayavanade Too bad you got no response on this. Did you end up finding a solution to it? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Greetings,
I'm currently working with Next.js version 12.2.4 on an application that supports over 60 language locales, each using URLs in its respective language. During the build process, static paths are successfully fetched from the server, and getStaticProps performs well, retrieving all required data.
However, a problem arises when it's time to save statically generated files to the file system. Non-Latin characters are being escaped in the file name, resulting in an exceptionally long name that ultimately leads to a build failure. Here's a sample URL for reference:
/home/حقائق-سريعة-قضايا-صحَّة-المرأة/مُضَاعَفاتُ-المَخاضِ-والوِلادة/الولادة-القيصريَّة-c-section
.The error message is as follows:
Error occurred prerendering page "/ar/home/%D8%AD%D9%82%D8%A7%D8%A6%D9%82-%D8%B3%D8%B1%D9%8A%D8%B9%D8%A9-%D9%82%D8%B6%D8%A7%D9%8A%D8%A7-%D8%B5%D8%AD%D9%91%D9%8E%D8%A9-%D8%A7%D9%84%D9%85%D8%B1%D8%A3%D8%A9/%D8%A7%D9%84%D8%B9%D9%8E%D8%AF%D9%88%D9%89-%D8%A7%D9%84%D9%85%D9%87%D8%A8%D9%84%D9%8A%D9%91%D9%8E%D8%A9-%D9%88%D8%A7%D9%84%D8%AF%D9%91%D9%8E%D8%A7%D8%A1-%D8%A7%D9%84%D8%A7%D9%84%D8%AA%D9%90%D9%87%D8%A7%D8%A8%D9%8A%D9%91-%D8%A7%D9%84%D8%AD%D9%88%D8%B6%D9%8A%D9%91/%D8%A7%D9%84%D8%AA%D9%87%D8%A7%D8%A8-%D8%A7%D9%84%D9%81%D8%B1%D8%AC". Read more: https://nextjs.org/docs/messages/prerender-error Error: ENAMETOOLONG: name too long, mkdir '/datadrive/agent3/_work/1/s/src/Project/MerckManuals/nextjs/.next/export/ar/home/%D8%AD%D9%82%D8%A7%D8%A6%D9%82-%D8%B3%D8%B1%D9%8A%D8%B9%D8%A9-%D9%82%D8%B6%D8%A7%D9%8A%D8%A7-%D8%B5%D8%AD%D9%91%D9%8E%D8%A9-%D8%A7%D9%84%D9%85%D8%B1%D8%A3%D8%A9/%D8%A7%D9%84%D8%B9%D9%8E%D8%AF%D9%88%D9%89-%D8%A7%D9%84%D9%85%D9%87%D8%A8%D9%84%D9%8A%D9%91%D9%8E%D8%A9-%D9%88%D8%A7%D9%84%D8%AF%D9%91%D9%8E%D8%A7%D8%A1-%D8%A7%D9%84%D8%A7%D9%84%D8%AA%D9%90%D9%87%D8%A7%D8%A8%D9%8A%D9%91-%D8%A7%D9%84%D8%AD%D9%88%D8%B6%D9%8A%D9%91'
It's a recurring issue for all non-Latin languages, including but not limited to Vietnamese, Japanese, Russian, and Arabic.
We use a straightforward 'next build' command to execute the build. Our build server operates on Linux 20.04. We attempted installing Arabic locales, but it did not resolve the issue.
I'm seeking a way to prevent Next.js from escaping the file name, thereby preserving it in its original language. Alternatively, any recommendations on how we might overcome/workaround this limitation would be greatly appreciated.
Looking forward to your suggestions and guidance on this matter.
Best Regards,
Alexander
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions