-
Notifications
You must be signed in to change notification settings - Fork 0
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 on Vercel Deployment #1
Comments
Hey there, sorry for not putting up a warning about this issue. You’re not doing anything wrong and I’m planning to propose a fix for this soon (in the Vercel SvelteKit adapter). Here’s why it happens: The default font is currently not being bundled together in the edge function where @vercel/og is being used. This occurs because the esbuild settings for adapter-vercel does not specify to copy over font files. As a result, your deployment fails when it analyses your bundled code and can’t find the font file. The demo website from this repository works around this by running
Now that esbuild is configured to copy over the font file that @vercel/og requires with the precise name it was given, this package uses a little hack by referencing the asset in an import so that esbuild knows it should copy over the font file. svelte-og-image/src/lib/index.ts Line 7 in 53704ce
Without this, the font file will not get copied over because esbuild doesn’t know about it since the@vercel/og package only references the asset in a URL constructor (which esbuild does not recognise yet) instead of an import .evanw/esbuild#795 In the end this really needs to be fixed in @sveltejs/adapter-vercel (and optionally @vercel/og too but it is not open-sourced). However, I’m currently away from my laptop until next Tuesday. |
Just need to wait for sveltejs/kit#11674 to be merged so that it can be used on the edge by specifying at least one font such as https://github.com/eltigerchino/svelte-og-image/blob/main/src/routes/og/%2Bserver.ts |
Hey,
first thanks for the library!
When I try to deploy my project to Vercel I get following error:
Generation Code I am using is:
Any Ideas what I am doing wrong?
The text was updated successfully, but these errors were encountered: