next.js: prefetch in combination with i18n and next/link locale:false result in 404 of defaultLocale

Bug report

Describe the bug

Use of i18n and defaultLocale returns in prefetched links in the defaultLocale to be 404 not found.

To Reproduce

Use i18n and SSG mode the prefetched links inside of the default locale are wrong.

Expected behavior

The generated refetch URL is wrong, defaultLocale === en

/_next/data/Zs6ypKU6jWKL8TDFyfTqC/home.json
instead of:
/_next/data/Zs6ypKU6jWKL8TDFyfTqC/en/home.json

https://storyblok-mui-planettraining-dohomi.lumenmedia1.vercel.app/

System information

  • OS: every
  • Browser every
  • Version of Next.js: 10.0.1
  • Version of Node.js: 12.x

Additional context

It seems that the defaultLocale is missing the defaultLocale inside of the PATH of the generated prefetch data links

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 2
  • Comments: 20 (9 by maintainers)

Commits related to this issue

Most upvoted comments

The updated behavior for the fallback locale is now in https://github.com/vercel/next.js/pull/19322 and will be available after that is landed

The _next/data links are still loaded on hover, prefetch={false} disables prefetching when the item is in the viewport. See related thread here https://github.com/vercel/next.js/pull/19299#issuecomment-730533444