Some error-processing paths use instanceof Error, instanceof TypeError, or an equivalent current-realm constructor check. Errors created by another JavaScript realm do not share the current realm constructor prototype, so these checks fail.
This can cause linked causes and AggregateError children to be dropped, error-valued object properties to be treated as plain data, and fetch TypeError messages not to receive hostname enhancement.
The SDK already exposes the realm-tolerant isError helper. These call sites should use it and, where needed, verify error.name to retain the TypeError restriction.
Some error-processing paths use
instanceof Error,instanceof TypeError, or an equivalent current-realm constructor check. Errors created by another JavaScript realm do not share the current realm constructor prototype, so these checks fail.This can cause linked causes and AggregateError children to be dropped, error-valued object properties to be treated as plain data, and fetch TypeError messages not to receive hostname enhancement.
The SDK already exposes the realm-tolerant
isErrorhelper. These call sites should use it and, where needed, verifyerror.nameto retain the TypeError restriction.