next.js
3f75387b - Fallback to localhost for metadataBase when it's used and missing (#47910)

Commit
2 years ago
Fallback to localhost for metadataBase when it's used and missing (#47910) [slack thread](https://vercel.slack.com/archives/C04G5LHAVAR/p1680106437791819?thread_ts=1680013412.588999&cid=C04G5LHAVAR) When `metadataBase` is missing and used for resolving og/tw image urls, we'll fallback to localhost for it to always safely resolve the url instead of erroring. Instead, we give a warning in console for which url is resolved but with fallback `metadataBase`. Once they found the warning and it's not expected, they need to update the `metadataBase` to a proper URL for giving the right domain. Another minor change is always resolve canonical with current pathname if it's a URL instance. Remove `resolveStringUrl` as it's not required anymore, the default `pathname` for `resolveUrl` is '', so no trailing slash needs to be removed
Author
Parents
Loading