Skip to content

hotfix: serve icon.svg + apple-icon.png as static assets#13

Merged
jrphilo merged 1 commit into
mainfrom
hotfix/icons-static
Apr 23, 2026
Merged

hotfix: serve icon.svg + apple-icon.png as static assets#13
jrphilo merged 1 commit into
mainfrom
hotfix/icons-static

Conversation

@jrphilo
Copy link
Copy Markdown
Collaborator

@jrphilo jrphilo commented Apr 23, 2026

Summary

Same failure mode as the OG route handlers before we fixed them. Next's app-router treats src/app/icon.svg and src/app/apple-icon.png as metadata files and emits them as prerendered route handlers (.body + .meta). OpenNext doesn't promote those to static assets → 404 on preview → Slack unfurl has no favicon.

Move both to public/ + declare explicit icons metadata in the layout. favicon.ico stays put (Next handles that one correctly).

Test plan

  • pnpm build + pnpm exec opennextjs-cloudflare build succeed
  • .open-next/assets/icon.svg and .open-next/assets/apple-icon.png present
  • After deploy, /icon.svg and /apple-icon.png return 200 on preview
  • Fresh URL share in Slack shows favicon in the unfurl card

Same failure mode as the OG route handlers: Next's app-router treats
src/app/icon.svg and src/app/apple-icon.png as metadata files and emits
them as prerendered route handlers (.body + .meta pairs). OpenNext
Cloudflare doesn't promote those to static assets, so on preview they
return 404. Slack's unfurl then has no usable favicon and omits it.

Move both files to public/ so they're plain static assets, and declare
them explicitly in the layout's icons metadata so Next still emits the
<link> tags. favicon.ico stays in src/app/ (Next handles that one; works
already). Result: /icon.svg and /apple-icon.png both land in the worker's
assets bundle and serve via the edge CDN.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 23, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
docs-preview 1f623ab Commit Preview URL

Branch Preview URL
Apr 23 2026, 03:36 PM

@jrphilo jrphilo merged commit 6366d63 into main Apr 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant