I’m encountering build issues with a Next.js project that uses internationalization for 404 pages. According to Next.js documentation, you cannot pass getServerSideProps to custom 404 pages. However, during the build process, I am receiving warnings that the export encountered errors on the paths corresponding to different language directories for the 404 page.
2024-04-26T14:38:36.841Z [INFO]: Generating static pages (27/36)
2024-04-26T14:38:36.980Z [INFO]: Generating static pages (36/36)
2024-04-26T14:38:36.997Z [WARNING]: Export encountered errors on following paths:
/404
/404/ar/404
/404/bn/404
...
/404/zh/404
2024-04-26T14:38:37.027Z [ERROR]: Build failed
The internationalized paths for the 404 page are resulting in build errors. Has anyone encountered a similar issue and found a workaround to successfully build internationalized static 404 pages in Next.js?