opennextjs-netlify: Builds error when using next's i18n due to lack of `serverless/pages/index.html` file

I’m trying to move a Next.js site (which uses next’s i18n routing) over to Netlify, but sadly can’t due to this error:

Error: ENOENT: no such file or directory, stat '.next/serverless/pages/index.html'

It’s true that this file doesn’t exist. Instead, the default homepage can be found at ‘.next/serverless/pages/en/index.html’ (replacing “en” with whatever default locale is set in next.config.js).

It would be great to detect if i18n is in use, and then get the homepage’s file location by reading the default locale.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 22

Most upvoted comments

great! i’m not blocked, so happy to downgrade for now. it must be a big challenge to continue covering all cases

Ah understood! Yes it’s a getStaticProps page without any revalidation or fallback 😃