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
- Ensure data prefetch for default locale is correct (#19085) This makes sure SSG data is correctly prefetched for the default locale and other locales on the same page. Tests for this behavior have be... — committed to vercel/next.js by ijjk 4 years ago
- Update fallback locale for locale: false (#19322) This updates the fallback locale for `locale: false` to be the `defaultLocale` instead of the currently active `locale` as it allows passing through ... — committed to vercel/next.js by ijjk 4 years ago
- Update fallback locale for locale: false (#19322) This updates the fallback locale for `locale: false` to be the `defaultLocale` instead of the currently active `locale` as it allows passing through ... — committed to kamermans/next.js by ijjk 4 years ago
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 landedThe
_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