You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
setup (the is some additional information in readme)
build project vercel build
deploy it vercel deploy --prebuilt
This will produce a build that contains metadata paths with localhost:300 that cannot be deployed anywhere as it will result 404 for users
to fix this behavior you can literally remove http://localhost:3000 from all places where is used and will work fine
Current vs. Expected behavior
Current
Currently, page will contain the full URL but is not needed
<head><metacharset="utf-8"><metaname="viewport" content="width=device-width, initial-scale=1"><linkrel="preload" href="/_next/static/chunks/webpack-bf1a64d1eafd2816.js" as="script" fetchpriority="low"><scriptsrc="/_next/static/chunks/fd9d1056-bdbc21787612b876.js" async=""></script><scriptsrc="/_next/static/chunks/864-2c350c1e805e4a45.js" async=""></script><scriptsrc="/_next/static/chunks/main-app-162fd94f9d2a73de.js" async=""></script><metaproperty="og:image:type" content="image/png"><metaproperty="og:image:width" content="1838"><metaproperty="og:image:height" content="931"><!-- Check This URL Here 👇 --><metaproperty="og:image" content="http://localhost:3000/opengraph-image.png?b133443553340dc8"><metaname="twitter:card" content="summary_large_image"><metaname="twitter:image:type" content="image/png"><metaname="twitter:image:width" content="1838"><metaname="twitter:image:height" content="931"><!-- Check This URL Here 👇 --><metaname="twitter:image" content="http://localhost:3000/twitter-image.png?b133443553340dc8"><scriptsrc="/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js" nomodule=""></script><metaname="d41d8cd98f00b204e9800998ecf8427e_lib_detect" id="d41d8cd98f00b204e9800998ecf8427e_lib_detect"></head>
You need to specify the metadataBase when you deploy the app, it's required for social platform to resolve the social images, relative path won't work well on every app.
You should see the warning metadata.metadataBase is not set for resolving social open graph or twitter images
Enforcing localhost:300 will cause problems that definitely would work on every app.
What if I do not know the metadataBase URL beforehand?
In the case of manually building and deploying with a local machine or CI/CD
for example vercel build && vercel deploy --prebuilt will get a URL at the end of the deployment
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Link to the code that reproduces this issue
https://github.com/BeroBurny/metadata-url
To Reproduce
vercel build
vercel deploy --prebuilt
This will produce a build that contains metadata paths with
localhost:300
that cannot be deployed anywhere as it will result404
for usersto fix this behavior you can literally remove
http://localhost:3000
from all places where is used and will work fineCurrent vs. Expected behavior
Current
Currently, page will contain the full URL but is not needed
You can find a deployed site here https://metadata-1kebb4lao-beroburny.vercel.app/
Expected
You can find a deployed site here https://metadata-973uqdhi2-beroburny.vercel.app/
Additional
Result URL used on discord
Or this tool can be used to preview https://www.opengraph.xyz/
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #33~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep 7 10:33:52 UTC 2 Binaries: Node: 16.19.1 npm: 8.19.3 Yarn: 3.4.1 pnpm: N/A Relevant Packages: next: 13.5.4-canary.6 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Metadata (metadata, generateMetadata, next/head)
Additional context
Found similar issues
opengraph-image
is 404 in route group segments, both image and dynamic #48106The text was updated successfully, but these errors were encountered: