Chat Message Failed to Render
Attempting to load multiple svelte elements into a chat message. So far I was successful, but the moment I try to add a specific
anchor
to the svelte component, it breaks, resulting in:9 Replies
The
renderChatHook
looks as follows:
In comparison, another element works:
Read the Svelte docs again.
anchor
must be a child of target
.a direct child I presume
Yes
Yes it has to be.
Indeed. Otherwise you'd change the target accordingly.
I think I should reference the
target
in the anchor
variable so I don't do mistakes like that in the future.
And something for future discord searchers.
and the new bot
already agreed to having my messages be public lol
yep, doing that works swell
Cool.. Yeah.. I didn't know how it would look re: new bot. It can't hurt for future folks looking for answers.
Well.. Glad you got things sorted quickly! 😄
I think I came across it actually but I just, kind of forgot about it lmao
rubber duck method
Ugh, though this is something I can't find
Is there an
anchor
for rendering the component after it?
I could just use the current target and then like, target whatever is after it I suppose
I guess .nextSibling
isn't the worst solution after looking it up.No, just providing a
target
renders at the end of its children. Providing an anchor
renders before a specific child. Technically you don't need an after
field.Sure, just would be nice to have a two-way anchor