-
Notifications
You must be signed in to change notification settings - Fork 27.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: missing metadataBase #45824
Error: missing metadataBase #45824
Comments
Experiencing the same issue in 3.1.7-canary.9 |
This is still an issue in
If people are agreed with the above, I can attempt a PR to solve it. |
The From https://developers.google.com/search/docs/crawling-indexing/consolidate-duplicate-urls We've updated the error message with more information, but still polishing it and will add docs link into the error message soon. |
@huozhi Google is not the only consumer of canonical URLs, and the HTML spec does not require them to be absolute.
Source: RFC6596: The Canonical Link Relation Section 3 While I appreciate the rationale, I would argue that it's over-opinionated to restrict the usage to Google's recommendation. However, even if one wishes to use an absolute URL, the issue here remains that the I believe the desired behavior should be that if a |
alternate urls should allow string type for relative paths ## Bug Fixes #45824 - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) ---------
Fixed in 13.2.3 |
I got the issue today using 13.2.4 on vercel |
@ChristopherNowlan can you tell which url you're getting this error, there're some urls required to be set the |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Metadata (metadata, generateMetadata, next/head, head.js)
Link to the code that reproduces this issue
https://stackblitz.com/edit/vercel-next-js-dsf3tr
To Reproduce
Define a relative canonical URL (
metadata.alternates.canonical
) on a page without specifyingmetadataBase
in that same page.Describe the Bug
If a relative canonical URL is specified in the metadata of a page, an error is generated during build:
This occurs even if the
metadataBase
is included in themetadata
exported from a parent layout.This issue does not happen in
13.1.7-canary.7
and starts with13.1.7-canary.8
.Expected Behavior
A relative URL should be allowed for a canonical URL without the
metadataBase
being specified anywhere in the metadata export hierarchy.But if the
metadataBase
is specified in a parent metadata export (e.g. a layout) then it should be respected and used.Which browser are you using? (if relevant)
N/A
How are you deploying your application? (if relevant)
next run build
The text was updated successfully, but these errors were encountered: