Error - e.sendChatMessage is not a function

AI-generated summary

Users are troubleshooting an error where e.sendChatMessage is not a function occurs when trying to send GIFs in chat using Giphy or Tenor. Crius initially reported the issue with screenshots showing failed GIF insertion. JammyDodger tested successfully on their site and suggested updating Discourse and the theme component, noting their version (1abfe2e61d) was newer. Crius confirmed they were on an older version. merefield clarified that the version in use was over a month old and pointed to recent Chat API changes in the discourse-gifs plugin that require newer Discourse versions to function. After updating via /upgrade, Crius confirmed GIFs now work correctly. JammyDodger explained that Discourse doesn’t flag every daily commit as outdated, only version bumps, and users typically update for specific features or fixes. The root cause was an outdated Discourse version incompatible with the latest Chat API and GIF plugin changes.

Fresh out of the skillet:

Tried with both giphy and tenor, not that it would matter when the problem is not loading the content but putting it into the chat, but eh.

I’ve just sent one as a test here on Meta and it seems to be working fine. Have you also updated your Discourse to Latest along with the component?

It’s updated since I first raised the issue

My test site is on the latest version as of today 1abfe2e61d, which seems to be different than yours, so it looks like you could maybe try an update from your /upgrade page and see if that helps

I think there was an issue with gifs in chat a couple of weeks back, and the theme component update also relies on a later version of Discourse to work fully.

Yes, that commit/your Discourse version is over a month old DEV: Enable color CI output and tweak formatting (#21527) · discourse/discourse@eec10ef · GitHub

There have since been changes to the Chat API: FIX: uses chat api new sendChatMessage (#38) · discourse/discourse-gifs@eb3ec48 · GitHub
image

So I wouldn’t expect this to work either.

Weird that discourse didn’t warn me I was running an old version.

Anyway I’ve updated and now it seems to be properly adding the gifs in the chat as well. Thank you for helping finding out what was going wrong :slight_smile:

New commits are added almost every day. :slight_smile: Not everyone wants to update that often, so will generally only do one when they want a particular new feature or a fix they’ve been waiting on. The version checks with the green/red faces are done when there’s been a version bump rather than on every new commit. :+1: