Next.js: How to get static assets from within getStaticProps
This is a known issue in Next.js (see related discussion #32236), __dirname incorrectly resolves to / – you should use process.cwd() instead. From the Next.js Reading files documentation: Files can be read directly from the filesystem in getStaticProps. In order to do so you have to get the full path to a file. Since Next.js … Read more