Next.js Discord

Discord Forum

OG Image Font Issue - Same code works in one project and not the other

Unanswered
Gouty oak gall posted this in #help-forum
Open in Discord
Gouty oak gallOP
In two different projects I use the exact same code to load a font for an OG image.

    const font1 = fetch(
        new URL("../../../../assets/Dosis-Medium.ttf", import.meta.url)
      ).then((res) => res.arrayBuffer());


      const [font1Data] = await Promise.all([
        font1
      ]);


In one app it works fine. In the other it gives me the following error:

TypeError: Failed to parse URL from /_next/static/media/Dosis-Medium.c13c0de5.ttf


I am totally confused why the difference

1 Reply

Southeastern blueberry bee
@Gouty oak gall do you have edge enabled on both file ?