Error codes

Edit this page

SRV008

A node has the wrong shape.

  • Error: SerovalMalformedNodeError
  • Step: deserialize
  • Fields: nodeType and nodeId when the error is about a whole node, and detail with a short description of what is wrong.

What it means

A node in the input has a field that is missing, has the wrong type, or is out of range. Seroval rejects the whole input instead of building a value from it.

Common causes

  • The input was not produced by seroval, or was changed on the way.
  • The input was produced by a different seroval version.
  • Someone sent the input on purpose to attack the receiver.
  • A RegExp in the input has a source that is too long, or too many property escapes.
  • A plugin node that must never be decoded, such as the one for AbortController, reaches the receiver.

How to fix it

  • Use the same seroval version on both sides.
  • Check that the input reaches the receiver unchanged.
  • Treat the input as untrusted and drop it. See security.