TryGhost/Ghost · warning · Error
Failed to dislike comment
Error message
Failed to dislike comment
What it means
comments.dislike() POSTs to /members/api/comments/{comment.id}/dislike to register a dislike reaction. Mirrors the like() structure: returns 'Success' on ok, throws on non-ok, no body sent. Dislike is a labs-gated feature in Ghost comments.
Source
Thrown at apps/comments-ui/src/utils/api.ts:318
return 'Success';
} else {
throw new Error('Failed to unlike comment');
}
});
},
dislike({comment}: {comment: {id: string}}) {
const url = endpointFor({type: 'members', resource: `comments/${comment.id}/dislike`});
return makeRequest({
url,
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
}).then(function (res) {
if (res.ok) {
return 'Success';
} else {
throw new Error('Failed to dislike comment');
}
});
},
undislike({comment}: {comment: {id: string}}) {
const body = {
comments: [comment]
};
const url = endpointFor({type: 'members', resource: `comments/${comment.id}/dislike`});
return makeRequest({
url,
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(body)
}).then(function (res) {
if (res.ok) {
return 'Success';View on GitHub (pinned to 47d8b0e2ad)
Solutions
- Check the Network tab POST response status and body.
- Gate the dislike button visibility on the labs flag returned by site.settings() to avoid 403s.
- Optimistically update and revert on error; disable the button during the request.
- If 401, re-authenticate; if 403, hide the dislike UI and refresh settings.
Defensive patterns
Strategy: validation
Validate before calling
function isDislikesEnabled(labs: {dislikes?: boolean} | undefined): boolean {
return Boolean(labs?.dislikes);
} Try / catch
setDisliked(true);
try {
await api.comments.dislike({comment});
} catch (e) {
setDisliked(false);
if (e instanceof Error && e.message === 'Failed to dislike comment') {
// if 403, dislikes may be disabled — refresh labs
}
} Prevention
- Gate the dislike button on the labs flag from site.settings() to avoid 403s.
- Disable the button during the POST; use optimistic UI with rollback.
- Refresh site settings if a 403 occurs, since the labs flag may have changed.
When it happens
Trigger: The POST returns 4xx/5xx. The member is unauthenticated (401), already disliked (409/400), the comment was deleted (404), the labs flag for dislikes is disabled (403), or rate limited (429).
Common situations: A member dislikes a comment but the site admin disabled the dislike labs feature after the UI rendered the button. Session expiry. A double-click submits two dislikes.
Related errors
- Failed to undislike comment
- Failed to like comment
- Failed to unlike comment
- Failed to fetch site data
- Failed to fetch comments
AI-assisted analysis of TryGhost/Ghost@47d8b0e2ad (2026-08-13).
Data as JSON: /api/errors/d2419792a5ac1931.
Report an issue: GitHub.