Skip to content

Fix metadata.config exceeding Hex 2.4.2's 128KB limit#350

Open
crayment wants to merge 1 commit into
aesmail:masterfrom
crayment:fix/metadata-config-size
Open

Fix metadata.config exceeding Hex 2.4.2's 128KB limit#350
crayment wants to merge 1 commit into
aesmail:masterfrom
crayment:fix/metadata-config-size

Conversation

@crayment

@crayment crayment commented May 8, 2026

Copy link
Copy Markdown

Problem

kaffy 0.10.3 and 0.11.0 fail to install under Hex 2.4.2+ with:

** (Mix) Unpacking tarball failed: file too big: metadata.config

Hex 2.4.2 (released April 30, 2026) vendors hex_core v0.15.0, which introduced a hard limit of 128KB (131,072 bytes) on metadata.config during tarball extraction. kaffy's metadata.config is currently 134,692 bytes — 3,620 bytes over the limit — because mix.exs has no explicit files: list, so Hex includes all 1,591 FontAwesome SVG icons and other development-only assets in the published package.

Any project depending on kaffy that runs mix deps.get without a warm deps/ cache will fail. Projects with warm caches won't notice until the cache expires or they set up a fresh environment.

You can reproduce it locally:

rm -rf deps/kaffy
mix local.hex --force  # ensure Hex 2.4.2+
mix deps.get

Fix

Add an explicit files: list to package/0 in mix.exs, keeping only the assets that kaffy's templates and code actually reference at runtime. This reduces metadata.config from 134,692 bytes → 7,259 bytes.

What's excluded:

  • 1,591 FontAwesome SVG icons (fontawesome/svgs/) — the main offender
  • FontAwesome JS distribution (fontawesome/js/) — templates use CSS approach, not SVG-with-JS
  • FontAwesome sprites (fontawesome/sprites/)
  • SCSS source files and maps
  • Demo/sample images (faces/, faces-clipart/, unused dashboard images)
  • Unused favicon variants (only favicon-32x32.png is referenced by templates)

What's kept: everything kaffy's shipped templates and code actually load — all CSS, JS, Ubuntu fonts, FontAwesome webfonts, and the handful of images referenced by templates.

Verified against the full template and source scan:

  • all.css loads fonts via ../webfonts/*
  • style.css loads Ubuntu fonts via ../fonts/Ubuntu/*
  • No asset references from resource_form.ex or utils.ex are missed ✓
  • backup.html.eex uses only CDN URLs, no local assets ✓

References

Add explicit files: list to package/0 in mix.exs to exclude unused
static assets from the published Hex package. Without this, Hex includes
all 1,591 FontAwesome SVG icons and other development-only assets, pushing
metadata.config to 134,692 bytes — over the 131,072 byte limit enforced
by hex_core v0.15.0 (shipped in Hex 2.4.2).

After this change metadata.config is 7,259 bytes.

The excluded assets (FontAwesome SVGs/JS/sprites, SCSS sources, demo
images) are not referenced by any of kaffy's shipped templates or code.
All runtime-required assets are preserved.

Fixes: aesmail#349
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