5a76c4fbb455906f4bc5c52e6ad2a01c22d73abe
archiver v8 changed its CJS export from a function to an object of class
constructors ({ Archiver, ZipArchive, TarArchive, JsonArchive }). The route
still called archiver('zip', opts), which throws `TypeError: archiver is not
a function` — a deterministic throw in the main flow, returning 500.
This was masked until the prior membership fix: before it, the empty
assetToGrantedAlbum map made the route 404 at "No valid assets found"
*before* reaching the archiver line. Once the map populated and downloads
were authorized, execution reached archiver('zip') and threw.
Fixed: `new archiver.ZipArchive({ zlib: { level: 0 } })` — same
pipe/append/finalize/abort interface. Verified the full round-trip
(append → finalize → Readable.toWeb → drain) produces a valid PK zip.
Also surface the server error code in DownloadLightboxForm so future
failures show the real code (status + {code}) in the browser console and
alert instead of a generic "Download fehlgeschlagen".
Co-Authored-By: Claude <noreply@anthropic.com>
Languages
TypeScript
98.4%
CSS
1.3%
Shell
0.2%
Dockerfile
0.1%