Error codes

Edit this page

SRV001

A value cannot be serialized.

  • Error: SerovalUnsupportedTypeError
  • Step: parse
  • Fields: value, the value seroval cannot serialize. Development builds name only its type in the message.

What it means

Seroval met a value it has no way to send. The whole call stops, and nothing is written.

Common causes

  • A function, such as a callback in component props.
  • A class instance with no plugin for it.
  • A symbol that is not a well-known symbol such as Symbol.iterator.
  • A promise or a stream passed to serialize, crossSerialize or toJSON. These functions return at once, so they cannot wait for later values.
  • A RegExp while Feature.RegExp is in disabledFeatures, or a BigInt64Array or BigUint64Array while Feature.BigIntTypedArray is.
  • An array with too many holes, or a typed array that is too long to send.

How to fix it

  • Read the value field to find the value.
  • Transform the value into supported types before you serialize it. The supported types table lists them.
  • Send a promise or a stream with serializeAsync, toJSONAsync or crossSerializeStream.
  • Send a function or another value that both sides share by key with createReference.
  • Write a plugin for a class of your own.