Error codes

Edit this page

SRV002

A node has a type that is not supported.

  • Error: SerovalUnsupportedNodeError
  • Step: serialize or deserialize
  • Fields: nodeType, the type number of the node.

What it means

A node in the input has a type that this call does not accept. The input is the tree that toJSON and toCrossJSON produce.

Common causes

  • The input was not produced by seroval, or was changed on the way.
  • The input was produced by a newer seroval version with a node type this version does not know.
  • The input holds a RegExp or a Temporal value, and the receiver turned that feature off in disabledFeatures.
  • A tree from a stream function, with promises that settle later, is passed to compileJSON.

How to fix it

  • Use the same seroval version on both sides.
  • Check that the input reaches the receiver unchanged.
  • If the sender should not send the type, turn the feature off on the sender too. See feature flags.