-
Notifications
You must be signed in to change notification settings - Fork 27.5k
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
[NEXT-1047] OpenGraph does not work in AppDir dynamic routes #48704
Comments
Having the same issue with The code I have this problem with: astronomy-club-at-nitic/nitic-astronomy@06cf451
Thanks in advance |
@ReoHakase I notice you have a From what I've seen, if you have code that doesn't reference your |
Hi dear @khuezy The codeastronomy-club-at-nitic/nitic-astronomy@b74ff3f export async function GET(request: Request) {
try {
console.log('\n@@@@@\nHey next build, can you see me? I am a console.log() in the first line of try block!\n@@@@@\n');
// Parse parameters
const { searchParams } = new URL(request.url);
const props = OgPropsSchema.parse(Object.fromEntries(searchParams.entries())); The
|
### Why Default font file of `@vercel/og` is not loaded, because the og package is bundled by webpack and we should external it so that `fs.readFileSync` is bundled and manged that can't be traced by nft. ### How This PR externals `@vercel/og` so that they don't need to be bundled and files can be properly traced Closes NEXT-1047 Fixes #48704
We land a fix in 13.3.2-canary.8, could you try again with that new canary version? 🙏 |
Thank you for the attempt. I have tried canary.8 and canary.9 this morning and still seeing the error in my Vercel logs I have tried both I'll keep an eye on the thread to see if someone else has better luck testing. |
@huozhi I tried w/ latest canary.9 and got a different error:
Downgraded to 13.3.1, trying canary .11 now. |
@blakebullis would you mind sharing a reproduction for your case? |
Here is some basic information about my app's request URL structure and directory structure. I also dumbed down my route.jsx file, it could help show I built the It all works on localhost - but where Vercel is building and deploying my code - it cannot find the default font that is installed with the I don't know of any other way to share more details. The app is relatively new, so no custom-build scripts or network configurations besides what comes out of the box. // e.g url request // directory structure One thing that may be unique to me is I am running i18n-config and middleware.js for internationalization support(??) |
@blakebullis could you file a new issue with a full reproduction? |
@huozhi I think I got it working on I changed the node module from @khuezy I could not get the image working in an API endpoint like Calling the URL directly worked fine in production. Bug: Using |
This is now working in the latest 13.4.0, thanks! I had some unrelated issues that prevented me from confirming that it works. <3 |
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
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 22.3.0: Mon Jan 30 20:38:37 PST 2023; root:xnu-8792.81.3~2/RELEASE_ARM64_T6000 Binaries: Node: 18.14.0 npm: 9.3.1 Yarn: 1.22.19 pnpm: 7.27.0 Relevant packages: next: 13.3.1 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true)
Link to the code that reproduces this issue
https://github.com/khuezy/nextog
To Reproduce
npm install
npm run dev
"/api/og?title=hi"
'/vercel/path0/node_modules/next/dist/compiled/@vercel/og/noto-sans-v27-latin-regular.ttf'
Describe the Bug
When using
ImageResponse
in a dynamic open graph endpoint, the request fails b/c of a missing font file that it tries to load.NOTE: if you remove the "request" reference to grab the title (hence making the route static,) then it works w/o issue b/c it was able to load the font locally.
Expected Behavior
ImageResponse should work in dynamic app dir route.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
NEXT-1047
The text was updated successfully, but these errors were encountered: