vercel/next.js · error

mixed-type fixed key block claims a

Error message

mixed-type fixed key block claims a {value_footprint} byte value footprint, over the {MAX_INLINE_VALUE_SIZE} byte maximum

What it means

In a mixed-type fixed key block, each entry carries its own type and the header carries a single value footprint byte; that footprint must not exceed MAX_INLINE_VALUE_SIZE. This error is thrown when the footprint byte read from block[6] is larger than the format's maximum, indicating corrupt or out-of-format data.

Solutions

  1. Remove the corrupt cache directory and allow the cache to be regenerated.
  2. Confirm no concurrent writers or external tools touched the cache files.
  3. If it recurs on fresh caches, align versions (reader/writer format mismatch) and report an upstream bug.
Defensive patterns

Strategy: validation

Validate before calling

// Check the footprint byte before decoding a mixed-type block
function footprintValid(block: Buffer): boolean {
  if (block.length < 7) return false
  return block[6] <= MAX_INLINE_VALUE_SIZE
}

Try / catch

try {
  decodeMixedFixedKeyBlock(block)
} catch (e) {
  if (String(e).includes('value footprint')) {
    rmSync(storeDir, { recursive: true, force: true })
    // regenerate store
  } else throw e
}

Prevention

When it happens

Trigger: Decoding a fixed key block with header_type == FIXED_KEY_BLOCK_MIXED_VALUE_TYPE where be::read_u8(&block[6..]) > MAX_INLINE_VALUE_SIZE during static sorted file reads.

Common situations: Bit-flipped or truncated cache bytes, cache written by a different format version, or manual edits to persisted cache files.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of vercel/next.js@34433fd12e (2026-09-20). Data as JSON: /api/errors/e97371b35e573f03. Report an issue: GitHub.

Appendix: source

Thrown at turbopack/crates/turbo-persistence/src/static_sorted_file.rs:1708

/// How a fixed-size key block encodes its entry values, decoded from the block header.
struct FixedValueLayout {
    /// The type shared by every entry, or `None` if each entry carries its own type byte.
    value_type: Option<u8>,
    /// Value bytes per entry, including any per-entry type byte.
    val_size: usize,
    /// Total header size, which the entry data follows.
    header_size: usize,
}

/// Decodes the value layout from a fixed-size key block header.
fn fixed_value_layout(block: &[u8], header_type: u8) -> Result<FixedValueLayout> {
    if header_type == FIXED_KEY_BLOCK_MIXED_VALUE_TYPE {
        // Mixed-type block: the value size follows the header's type byte, and each entry
        // carries its own type.
        ensure!(block.len() >= 7, "mixed-type fixed key block too short");
        // Validate the value footprint byte
        let value_footprint = be::read_u8(&block[6..]) as usize;
        ensure!(
            value_footprint <= MAX_INLINE_VALUE_SIZE,
            "mixed-type fixed key block claims a {value_footprint} byte value footprint, over the \
             {MAX_INLINE_VALUE_SIZE} byte maximum"
        );
        Ok(FixedValueLayout {
            value_type: None,
            // +1 for the per-entry type byte, which is part of the stride.
            val_size: value_footprint + 1,
            header_size: 7,
        })
    } else {
        Ok(FixedValueLayout {
            value_type: Some(header_type),
            val_size: entry_val_size(header_type)?,
            header_size: 6,
        })
    }
}

View on GitHub (pinned to 34433fd12e)