davila7/claude-code-templates · error · Error
Decompression failed: ${error.message}
Error message
Decompression failed: ${error.message} What it means
Wrapped decode error from decompressWorkflow: the hash's compressed payload (after the '_') was percent-encoded, decoded, then run through decompression; any failure (corrupt data, wrong decompression impl, invalid UTF-8 after decodeURIComponent) is rethrown as 'Decompression failed: <cause>'.
Source
Thrown at cli-tool/src/index.js:2199
}
}
}
/**
* Decompress string with Unicode support
*/
function decompressString(compressed) {
try {
// Simple Base64 decoding with Unicode support
const decoded = Buffer.from(compressed, 'base64').toString('utf8');
// Convert URI encoded characters back
return decodeURIComponent(decoded.replace(/(.)/g, function(m, p) {
let code = p.charCodeAt(0).toString(16).toUpperCase();
if (code.length < 2) code = '0' + code;
return '%' + code;
}));
} catch (error) {
throw new Error(`Decompression failed: ${error.message}`);
}
}
/**
* Fetch workflow data from hash
* In production, this would fetch from a remote workflow registry
* For now, we'll simulate this functionality
*/
async function fetchWorkflowData(hash) {
try {
// Check if hash contains encoded data (new format: shortHash_encodedData)
if (hash.includes('_')) {
console.log(chalk.green('🔓 Decoding workflow from hash...'));
const [shortHash, encodedData] = hash.split('_', 2);
if (!encodedData) {
throw new Error('Invalid hash format: missing encoded data');View on GitHub (pinned to a0851ed10c)
Solutions
- Re-copy the hash verbatim, avoiding URL-decoding transformations (watch for '+' vs ' ')
- Regenerate the share link from the source dashboard
- Upgrade both ends (generator and CLI) to matching versions
- Note the underlying error.message to identify whether it failed at pako decompress or decodeURIComponent
Defensive patterns
Strategy: fallback
Validate before calling
null
Try / catch
try {
await installWorkflowFromHash(hash);
} catch (e) {
if (/Decompression failed/.test(e.message)) {
console.error('Hash payload corrupted in transit — recopy the full share link');
process.exit(1);
}
throw e;
} Prevention
- Copy hashes via clipboard (share button), never terminal text selection with line-wrap
- Avoid passing hashes through systems that URL-decode them
- Keep generator and CLI versions in sync
When it happens
Trigger: A hash of form 'short_compressedData' where the compressed segment is truncated or URL-mangled (e.g. '+'→' ' by a URL decoder), so the decompression step throws; the underlying cause is included in the message.
Common situations: Hashes pasted through channels that URL-decode or truncate (chat apps, terminals with line-wrap copy); hashes generated by an incompatible version of the compressor.
Related errors
- Failed to decode workflow data from hash
- Invalid workflow data structure in hash
- Invalid workflow hash format. Expected format: #hash
- Workflow with hash "${hash}" not found. Please check the has
- Invalid hash format: missing encoded data
AI-assisted analysis of davila7/claude-code-templates@a0851ed10c (2026-08-28).
Data as JSON: /api/errors/0549086aeaa4815d.
Report an issue: GitHub.