Skip to content
Classdiscord-component-embedv1.0.0

ComponentEmbedError

Thrown when a component tree breaks a rule of Discord's component embed format, or when your own code throws while the package reads the tree. Read code to tell which. Discord doesn't report an invalid payload. It shows the Open Graph card, or no preview at all for most payloads that break Discord's general component rules, like a bad id.

class ComponentEmbedError extends Error

Member visibility

Filter class members by access level.

Showing members with Protected visibility and higher.

Properties

name

public readonly name

path

The steps from the root to the component that broke a rule, like ['Container', 'PostCard', 'Section 2']. Your own components appear by name. A number marks a component written next to others with the same name. The path is empty when the problem is the whole embed, like its size. For a tree from fromPayload, the steps are JSON keys and array indexes counted from 0, like ['component', 'components', '1'].

public readonly path: readonly string[]