@solana/kit · Codecs

Solana error #8078023

CODECS__EXPECTED_DECODER_TO_CONSUME_ENTIRE_BYTE_ARRAY

Appears as Solana error #8078023; Decode this error by running `npx @solana/errors decode -- 8078023 '…'`

Message

This decoder expected a byte array of exactly $expectedLength bytes, but $numExcessBytes unexpected excess bytes remained after decoding. Are you sure that you have chosen the correct decoder for this data?

Placeholders (expectedLength, numExcessBytes) are filled from the error’s context. Paste the base64 argument below to see the real values.

What it means

The decoder finished with bytes left over, which means the layout does not match the data.

What to do

  • Make sure you are decoding the right account type and program version; regenerate the client from the current IDL.

Decode it locally instead

npx @solana/errors decode -- 8078023 '<base64 context>'

In development, import from @solana/kit as usual and the full message is thrown. In production the message is stripped to keep bundles small; the error object still carries error.context with the same values this page decodes, and isSolanaError(err, SOLANA_ERROR__CODECS__EXPECTED_DECODER_TO_CONSUME_ENTIRE_BYTE_ARRAY) lets you branch on it.

Decode another error

Try: