Commit e42501b
docs: inline OG font as base64 so Vercel function can read it
The previous code resolved the .ttf path via __dirname/path.resolve,
which Vite cannot statically analyze, so the font was never bundled
with the SSR build. Switching to ?url emitted the asset, but React
Router moves emitted assets to the client-only build — the function
cannot fs.readFile a client static asset on Vercel. Use ?inline to
embed the font as a data URL inside the SSR bundle, decode at first
call, and write to /tmp so skia-canvas can load it via path.
Also surface font-load errors instead of swallowing them, which is
what made the failure look like a blank white image instead of a 500.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 90d1084 commit e42501b
1 file changed
Lines changed: 17 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | | - | |
6 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
10 | 16 | | |
11 | 17 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
0 commit comments