AI Agent Component Spec
AI Agent Component Spec
| Field | Value |
|---|---|
| Page type | Troubleshooting reference |
| Scope | All CometChat Angular UIKit issues — initialization, rendering, theming, calling, extensions, AI Smart Chat Features, localization, sound, events |
| When to reference | When a component fails to render, data is missing, styling doesn’t apply, or a feature doesn’t appear |
Initialization and Login
| Symptom | Cause | Fix |
|---|---|---|
CometChatUIKit.init() fails silently | Invalid App ID, Region, or Auth Key | Double-check credentials from the CometChat Dashboard |
| Component doesn’t render | init() not called or not awaited before rendering | Ensure init() completes before mounting components. See Methods |
| Component renders but shows no data | User not logged in | Call CometChatUIKit.login() after init |
| Login fails with “UID not found” | UID doesn’t exist in your CometChat app | Create the user via Dashboard, SDK, or API first |
| Blank screen after login | Component mounted before init/login completes | Use state to conditionally render after login resolves |
getLoggedinUser() returns null | User not logged in or session expired | Call login() or loginWithAuthToken() first |
sendTextMessage() fails | User not logged in or invalid receiver | Ensure login completes before sending messages |
| Auth Key exposed in production | Using Auth Key instead of Auth Token | Switch to Auth Token for production |
Theming and CSS
| Symptom | Cause | Fix |
|---|---|---|
| CSS/theme not applied | Missing CSS import | Add @import url("@cometchat/chat-uikit-angular/styles/css-variables.css"); in your global styles |
| Overrides not applying | Missing .cometchat scope in selector | Scope overrides under .cometchat |
| Component-level override not working | Missing .cometchat parent in selector | Use .cometchat .cometchat-conversations not just .cometchat-conversations |
| Dark mode unchanged | data-theme missing or mismatch | Set data-theme="dark" on the wrapper |
| Font not changing | --cometchat-font-family set on wrong element | Set on .cometchat |
| Token change has no visible effect | Token doesn’t control the expected property | Check the theming documentation |
Components
| Symptom | Cause | Fix |
|---|---|---|
| Callback not firing | Wrong output name or signature | Check the Actions section on the component page for exact output name |
| Custom view not appearing | Returning null from ng-template | Ensure ng-template returns valid content |
| Messages not loading | Invalid user/group object passed | Ensure you fetch the user/group via SDK before passing to components |
Calling
| Symptom | Cause | Fix |
|---|---|---|
| Call buttons not appearing in Message Header | @cometchat/calls-sdk-javascript not installed | Run npm install @cometchat/calls-sdk-javascript@5.0.0-beta.1 — UIKit auto-detects it |
| Incoming call screen not showing | cometchat-incoming-call not in the component tree | Render the component at the app root level so it can listen for incoming calls |
Extensions
| Symptom | Cause | Fix |
|---|---|---|
| Extension feature not appearing | Extension not activated in CometChat Dashboard | Enable the specific extension from your Dashboard |
| Stickers not showing in composer | Sticker extension not enabled | Activate Sticker Extension in Dashboard |
| Polls option missing from action sheet | Polls extension not enabled | Activate Polls Extension in Dashboard |
| Link preview not rendering in messages | Link Preview extension not enabled | Activate Link Preview Extension in Dashboard |
AI Smart Chat Features
| Symptom | Cause | Fix |
|---|---|---|
| AI Smart Chat Features not appearing | Feature not activated in CometChat Dashboard | Enable the specific AI feature from your Dashboard |
| Conversation Starter not showing | Feature not enabled or no conversation context | Ensure Conversation Starter is activated in Dashboard |
| Smart Replies not appearing in composer | Feature not enabled in Dashboard | Ensure Smart Replies is activated in Dashboard |
Localization
| Symptom | Cause | Fix |
|---|---|---|
| UI text not translated | Language code not matching supported codes | Check the supported languages table in Localization |
| Custom translations not appearing | addTranslation called before init | Call init first, then add translations |
| Date/time format unchanged | Localization config not applied | Check the localization documentation for date format configuration |
Sound
| Symptom | Cause | Fix |
|---|---|---|
| No sound plays | Browser autoplay policy blocks audio before user interaction | hasInteracted() must return true — the user must interact with the page first |
| Custom sound not playing | Invalid file path or unsupported format | Ensure the path is correct and the file is a valid audio format (WAV/MP3) |
| Sound keeps playing | pause() not called | Call CometChatSoundManager.pause() to stop playback |
Events
| Symptom | Cause | Fix |
|---|---|---|
| Event listener not firing | Subscribed to wrong event name | Check the Events page for exact event names |
| Duplicate event triggers | Multiple subscriptions without cleanup | Unsubscribe in ngOnDestroy |
| Event fires but UI doesn’t update | State not updated in event handler | Ensure you update component state in the handler |
Component-Specific Troubleshooting
Base Elements
CometChatActionSheet
Actions Not Displaying
Ensure each action has the required properties:Icons Not Showing
Icons use CSS mask, so ensure:- Icon URLs are accessible
- Icons are SVG or PNG format
- Icon color is controlled by
--cometchat-icon-color-highlightCSS variable
Keyboard Navigation Not Working
Ensure:- The ActionSheet component has focus
- No other elements are capturing keyboard events
- The component is properly mounted in the DOM
CometChatConfirmDialog
Dialog Not Closing After Success
Ensure you’re callingsetSuccess() and then hiding the dialog:
Loading State Persists
Always call eithersetSuccess() or setError():
ViewChild Undefined
Ensure the dialog is rendered before accessing it:CometChatContextMenu
Menu Not Positioning Correctly
Ensure positioning configuration matches your use case:Submenu Not Showing
Check that:- You have more items than
topMenuSize - 1 - Items have required properties (
id,title,iconURL) - The component is properly mounted in the DOM
Icons Not Displaying
Icons use CSS mask, so ensure:- Icon URLs are accessible
- Icons are SVG or PNG format
- Icon color is controlled by
--cometchat-icon-color-secondaryCSS variable
Keyboard Navigation Not Working
Ensure:- The submenu is open
- Focus is within the component
- No other elements are capturing keyboard events
CometChatDate
Date Not Displaying
If the date is not showing:- Verify
timestampis in seconds, not milliseconds - Ensure
calendarObjectis provided with at least one format property - Check that the timestamp is a valid number
Wrong Date Format
If the date format is incorrect:- Verify format tokens are correct (case-sensitive)
- Check for typos in format strings
- Ensure literal text is wrapped in square brackets
[text]
Timezone Issues
The component uses the timezone configured in CometChatLocalize:CometChatFullscreenViewer
Viewer Not Opening
Problem: The viewer doesn’t open whenisOpen is set to true.
Solution: Verify:
isOpenproperty is properly bound with square brackets:[isOpen]="isViewerOpen"- No JavaScript errors in console
- Component is properly imported in your module/component
- CSS for the viewer is loaded
Images/Videos Not Displaying
Problem: Media items are not showing in the viewer. Solution: Ensure your attachments have valid structure:- URLs are accessible and not blocked by CORS
typeproperty is either'image'or'video'- URLs point to actual media files, not HTML pages
Navigation Buttons Not Working
Problem: Previous/Next buttons don’t navigate through the gallery. Solution: Check that:- You’re using gallery mode with
attachmentsarray (not single mode withurl) - Attachments array has more than one item
- No JavaScript errors in console
- Buttons are not disabled (check at boundaries)
Keyboard Navigation Not Working
Problem: Arrow keys don’t navigate through the gallery. Solution: Verify:- Viewer is actually open (
isOpenistrue) - You’re in gallery mode with multiple attachments
- No other keyboard event listeners are preventing default behavior
- Browser window has focus
Video Not Playing
Problem: Video displays but doesn’t play or shows error. Solution: Check:- Video URL is valid and accessible
- Video format is supported by HTML5 video element (MP4, WebM, Ogg)
- No CORS issues blocking video playback
- Browser supports the video codec
Body Scroll Not Restored
Problem: Page remains unscrollable after closing the viewer. Solution: Ensure:- You’re calling the
closeClickevent handler - Setting
isOpentofalsein the handler - Component is not being destroyed while open
Focus Not Returning After Close
Problem: Focus doesn’t return to the triggering element after closing. Solution: The component automatically handles focus restoration. If it’s not working:- Ensure the triggering element still exists in the DOM
- Check that no other code is managing focus
- Verify the triggering element is focusable (has
tabindexor is naturally focusable)
Sender Information Not Showing
Problem: Sender name and avatar are not displayed in the header. Solution: Provide sender information via one of these methods:Index Display Not Showing
Problem: The “X of Y” counter is not visible. Solution: Verify:- You’re using gallery mode with
attachmentsarray - Attachments array has more than one item
- CSS for index display is not being overridden
- Localization key
fullscreen_viewer_indexexists
Styling Not Applying
Problem: Custom CSS variables are not affecting the component’s appearance. Solution: Ensure:- CSS variables are defined on the correct selector
- Variable names match exactly (including
--cometchat-prefix) - CSS specificity is sufficient
Conversations
CometChatConversations
Conversations Not Loading
Problem: Conversations list is empty or not loading. Solutions:- Verify CometChat SDK is initialized and user is logged in
- Check network connectivity
- Verify API credentials are correct
- Check browser console for error messages
- Ensure
conversationsRequestBuilderis properly configured
Real-Time Updates Not Working
Problem: New messages don’t appear automatically. Solutions:- Verify WebSocket connection is established
- Check that listeners are properly set up
- Ensure component is not destroyed prematurely
- Check browser console for listener errors
Typing Indicators Not Showing
Problem: Typing indicators don’t appear. Solutions:- Verify typing indicators are enabled in CometChat dashboard
- Check that
hideUserStatusis not set totrue - Ensure typing events are being sent from other users
- Check listener setup in ConversationsService
Performance Issues with Large Lists
Problem: Slow scrolling or rendering with many conversations. Solutions:- Reduce
limitinconversationsRequestBuilder(default: 30) - Enable virtual scrolling (future enhancement)
- Use
trackByfunction in custom templates - Optimize custom template complexity
Custom Templates Not Rendering
Problem: Custom templates don’t appear. Solutions:- Verify template reference variable name matches
[templateView]binding - Check that template is defined in the same component
- Ensure template context is properly typed
- Check browser console for template errors
Context Menu Not Working
Problem: Context menu doesn’t appear or actions don’t work. Solutions:- Verify
optionsfunction returns validCometChatOption[] - Check that
onClickhandlers are properly bound - Ensure
hideDeleteConversationis not hiding all options - Check browser console for click handler errors
Selection Mode Issues
Problem: Selection doesn’t work or behaves unexpectedly. Solutions:- Verify
selectionModeis set to'single'or'multiple'(not'none') - Check that
onSelectevent handler is properly implemented - Ensure selection state is managed correctly in parent component
- Check that selection controls are visible
Users & Groups
CometChatUsers
Users Not Loading
Problem: Users list is empty or not loading. Solutions:- Verify CometChat SDK is initialized and user is logged in
- Check network connectivity
- Verify API credentials are correct
- Check browser console for error messages
- Ensure
usersRequestBuilderis properly configured
Real-Time Updates Not Working
Problem: User status changes don’t appear automatically. Solutions:- Verify WebSocket connection is established
- Check that listeners are properly set up
- Ensure component is not destroyed prematurely
- Check browser console for listener errors
Search Not Working
Problem: Search doesn’t filter users. Solutions:- Verify
hideSearchis not set totrue - Check that
searchRequestBuilderis properly configured - Ensure search keyword meets minimum length requirements
- Check browser console for search errors
Selection Not Working
Problem: Selection doesn’t work or behaves unexpectedly. Solutions:- Verify
selectionModeis set to'single'or'multiple' - Check that
(select)event handler is properly implemented - Ensure selection state is managed correctly in parent component
CometChatGroups
Groups Not Loading
Problem: Groups list is empty or not loading. Solutions:- Verify CometChat SDK is initialized and user is logged in
- Check network connectivity
- Verify API credentials are correct
- Check browser console for error messages
- Ensure
groupsRequestBuilderis properly configured
Real-Time Updates Not Working
Problem: Group member changes don’t appear automatically. Solutions:- Verify WebSocket connection is established
- Check that listeners are properly set up
- Ensure component is not destroyed prematurely
- Check browser console for listener errors
Search Not Working
Problem: Search doesn’t filter groups. Solutions:- Verify
hideSearchis not set totrue - Check that
searchRequestBuilderis properly configured - Ensure search keyword meets minimum length requirements
CometChatGroupMembers
Members Not Loading
Problem: Members list is empty or not loading. Solutions:- Verify CometChat SDK is initialized and user is logged in
- Ensure a valid
groupinput is provided — the component requires aCometChat.Groupobject - Check network connectivity
- Verify API credentials are correct
- Check browser console for error messages
- Ensure
groupMemberRequestBuilderis properly configured with the correct group GUID
Real-Time Updates Not Working
Problem: Member changes (join, leave, kick, ban) don’t appear automatically. Solutions:- Verify WebSocket connection is established
- Check that group listeners are properly set up
- Ensure component is not destroyed prematurely
- Check browser console for listener errors
Search Not Working
Problem: Search doesn’t filter members. Solutions:- Verify
hideSearchis not set totrue - Check that
searchRequestBuilderis properly configured - Ensure search keyword meets minimum length requirements
Scope Change Not Working
Problem: Cannot change member scope. Solutions:- Verify the logged-in user is the group owner or an admin
- Ensure
hideScopeChangeOptionis not set totrue - Check that the target member has a lower scope than the logged-in user
- Owners cannot have their scope changed
Messages
CometChatMessageHeader
Common Issues
1. User/Group not displaying Ensure you’re passing a validCometChat.User or CometChat.Group object:
showBackButton property:
false:
showSearchOption and showConversationSummaryButton must be true for the overflow menu:
Performance Tips
- Use OnPush Change Detection: The component uses
ChangeDetectionStrategy.OnPushfor optimal performance - Avoid Frequent Input Changes: Minimize unnecessary changes to
userorgroupinputs - Clean Up on Destroy: The component automatically cleans up listeners on destroy
CometChatMessageList
This section provides solutions to common issues, explains error messages, offers debugging tips, and lists support resources to help you resolve problems quickly when working with the CometChatMessageList component.Common Issues and Solutions
Below are the most frequently encountered issues and their solutions.Messages Not Loading
Symptoms:- Message list shows empty state or loading spinner indefinitely
- No messages appear even though the conversation has messages
- Console shows network errors or SDK errors
| Cause | Solution |
|---|---|
| CometChat not initialized | Ensure CometChatUIKit.init() is called before using the component |
| User not logged in | Verify CometChatUIKit.login() completed successfully |
| Invalid user/group | Check that the user or group input is a valid CometChat object |
| Network connectivity | Check internet connection and CometChat service status |
| Incorrect App ID/Region | Verify your App ID and region in CometChat dashboard |
Real-time Updates Not Working
Symptoms:- New messages don’t appear automatically
- Message edits/deletions don’t reflect in real-time
- Typing indicators don’t show
- Read receipts don’t update
| Cause | Solution |
|---|---|
| WebSocket not connected | Ensure autoEstablishSocketConnection(true) in app settings |
| Presence subscription disabled | Add subscribePresenceForAllUsers() to app settings |
| Component destroyed | Verify component is still mounted when expecting updates |
| Wrong conversation context | Ensure user or group input matches the conversation |
Scroll Issues
Symptoms:- Messages jump when scrolling
- Scroll position resets unexpectedly
- Cannot scroll to bottom
- Infinite scroll not loading older messages
| Issue | Cause | Solution |
|---|---|---|
| Scroll jumping | Images loading without dimensions | Use fixed dimensions or aspect-ratio CSS |
| Position reset | Component re-rendering | Check for unnecessary state changes |
| Can’t scroll to bottom | Button not visible | Ensure container has proper height |
| Infinite scroll broken | Scroll container misconfigured | Verify parent container has overflow: auto |
Styling Not Applying
Symptoms:- CSS changes don’t affect the component
- Custom styles are overridden
- Theme changes don’t apply
| Cause | Solution |
|---|---|
| View encapsulation | Use ::ng-deep or set ViewEncapsulation.None |
| CSS specificity | Increase specificity or use !important sparingly |
| CSS variables not set | Ensure variables are defined in :root or parent |
| Dark theme not applied | Set data-theme="dark" on document element |
Thread View Not Opening
Symptoms:- Clicking thread replies does nothing
- Thread panel doesn’t appear
threadRepliesClickevent not firing
| Cause | Solution |
|---|---|
| Event not bound | Add (threadRepliesClick)="onThreadClick($event)" to template |
| Thread option hidden | Ensure hideReplyInThreadOption is false |
| No thread handler | Implement the thread navigation logic |
| Message has no replies | Thread indicator only shows for messages with replies |
Reactions Not Working
Symptoms:- Reaction button doesn’t appear
- Cannot add/remove reactions
- Reactions don’t update in real-time
| Cause | Solution |
|---|---|
| Reactions hidden | Set hideReactionOption to false |
| Reactions extension disabled | Enable Reactions extension in CometChat dashboard |
| Event not handled | Bind (reactionClick) event handler |
| SDK version mismatch | Update to latest CometChat SDK version |
Performance Issues
Symptoms:- Slow scrolling or janky animations
- High memory usage
- Long initial load times
- UI freezes when loading messages
| Cause | Solution |
|---|---|
| Too many messages loaded | Reduce setLimit() in messages request builder |
| Heavy custom templates | Optimize templates, avoid expensive computations |
| Memory leaks | Clean up subscriptions in ngOnDestroy |
| Large media files | Implement lazy loading for images/videos |
| Change detection | Use OnPush change detection strategy |
Error Messages
This section explains common error messages you may encounter and provides resolution steps for each.Authentication Errors
| Error Code | Message | Cause | Resolution |
|---|---|---|---|
ERR_UID_NOT_FOUND | User with UID not found | Invalid user ID provided | Verify the UID exists in your CometChat dashboard |
ERR_AUTH_TOKEN_NOT_FOUND | Auth token not found | User not logged in or token expired | Call CometChatUIKit.login() before using components |
ERR_INVALID_AUTH_KEY | Invalid auth key | Wrong authentication key | Check auth key in CometChat dashboard |
ERR_APP_NOT_FOUND | App not found | Invalid App ID | Verify App ID matches your CometChat app |
Network Errors
| Error Code | Message | Cause | Resolution |
|---|---|---|---|
ERR_NETWORK | Network error | No internet connection | Check connectivity and retry |
ERR_TIMEOUT | Request timeout | Server took too long to respond | Retry with exponential backoff |
ERR_CONNECTION_REFUSED | Connection refused | Server unreachable | Check CometChat service status |
ERR_WEBSOCKET_DISCONNECTED | WebSocket disconnected | Real-time connection lost | Component auto-reconnects; check network |
Permission Errors
| Error Code | Message | Cause | Resolution |
|---|---|---|---|
ERR_NOT_A_MEMBER | User is not a member | User not in the group | Add user to group or check group membership |
ERR_BLOCKED | User is blocked | Blocked by the other user | Cannot send messages to blocked users |
ERR_GROUP_NOT_JOINED | Group not joined | User hasn’t joined the group | Join the group before sending messages |
ERR_PERMISSION_DENIED | Permission denied | Insufficient permissions | Check user role and permissions |
SDK Initialization Errors
| Error Code | Message | Cause | Resolution |
|---|---|---|---|
ERR_NOT_INITIALIZED | CometChat not initialized | CometChatUIKit.init() not called | Initialize CometChat before using components |
ERR_ALREADY_INITIALIZED | Already initialized | CometChatUIKit.init() called multiple times | Call init only once at app startup |
ERR_INVALID_REGION | Invalid region | Wrong region code | Use correct region: ‘us’, ‘eu’, ‘in’, etc. |
ERR_APP_SETTINGS_NOT_FOUND | App settings not found | Missing app settings | Provide valid AppSettingsBuilder |
Invalid Parameter Errors
| Error Code | Message | Cause | Resolution |
|---|---|---|---|
ERR_INVALID_UID | Invalid UID | Empty or malformed user ID | Provide valid non-empty UID |
ERR_INVALID_GUID | Invalid GUID | Empty or malformed group ID | Provide valid non-empty GUID |
ERR_INVALID_MESSAGE_ID | Invalid message ID | Message ID doesn’t exist | Verify message ID is correct |
ERR_EMPTY_MESSAGE | Message cannot be empty | Trying to send empty message | Validate message content before sending |
Comprehensive Error Handler
Debugging Tips
This section provides practical debugging techniques to help you identify and resolve issues quickly.Using Browser DevTools
Console Tab:- Filter by
cometchatto see API calls - Check request/response payloads
- Verify WebSocket connection (WS filter)
- Look for failed requests (red entries)
Checking Network Requests
Inspecting Component State
Logging and Debugging Utilities
Common Debugging Scenarios
Scenario 1: Messages not appearingSupport Resources
If you need additional help, the following resources are available.Official Documentation
| Resource | URL | Description |
|---|---|---|
| CometChat Docs | cometchat.com/docs | Official documentation hub |
| Angular UIKit Guide | cometchat.com/docs/angular-uikit | Angular-specific documentation |
| API Reference | cometchat.com/docs/javascript-chat-sdk | JavaScript SDK reference |
| Release Notes | cometchat.com/docs/changelog | Latest updates and changes |
GitHub Resources
| Resource | URL | Description |
|---|---|---|
| Angular UIKit Repo | github.com/cometchat/cometchat-uikit-angular | Source code and issues |
| Sample Apps | github.com/cometchat/cometchat-sample-app-angular | Example implementations |
| Report Issues | GitHub Issues | Bug reports and feature requests |
Community and Support
| Channel | Access | Best For |
|---|---|---|
| CometChat Dashboard | app.cometchat.com | App management, API keys, analytics |
| Support Portal | help.cometchat.com | Ticket-based support |
| Discord Community | CometChat Discord | Community discussions |
| Stack Overflow | Tag: cometchat | Q&A with community |
When to Contact Support
Contact CometChat support when you encounter:- Server-side errors (5xx status codes)
- Account or billing issues
- Feature requests for the SDK or UIKit
- Security concerns or vulnerabilities
- Performance issues on CometChat infrastructure
- Issues not resolved by documentation or community
- Your App ID and region
- SDK and UIKit version numbers
- Steps to reproduce the issue
- Error messages and stack traces
- Browser/device information
- Code snippets (sanitized of sensitive data)
Frequently Asked Questions (FAQ)
General Questions
How do I display messages for a specific user?
How do I display messages for a specific user?
CometChat.User object to the user input:How do I display messages for a group?
How do I display messages for a group?
CometChat.Group object to the group input:Can I use both user and group inputs at the same time?
Can I use both user and group inputs at the same time?
user OR group, not both. If both are provided, user takes precedence. The component is designed for one conversation at a time.How do I refresh the message list?
How do I refresh the message list?
refreshMessages() method on the component instance:Customization Questions
How do I customize the appearance of message bubbles?
How do I customize the appearance of message bubbles?
- CSS Variables: Override CSS variables in your global styles
- Custom Templates: Use the
templatesinput for complete control - MessageBubbleConfigService: Set global customizations via the service
How do I hide specific message options (edit, delete, etc.)?
How do I hide specific message options (edit, delete, etc.)?
hide* input properties:How do I implement dark mode?
How do I implement dark mode?
data-theme attribute on the document element:How do I add custom text formatting (hashtags, mentions)?
How do I add custom text formatting (hashtags, mentions)?
Feature Questions
How do I implement thread view?
How do I implement thread view?
threadRepliesClick event and display a separate message list with parentMessageId:How do I enable smart replies and conversation starters?
How do I enable smart replies and conversation starters?
showSmartReplies and showConversationStarters inputs to true:How do I scroll to a specific message?
How do I scroll to a specific message?
goToMessageId input or the scrollToMessage() method:How do I handle message translation?
How do I handle message translation?
hideTranslateMessageOption input to show/hide the option, and the component handles the rest:Troubleshooting Questions
Why are messages not loading?
Why are messages not loading?
- CometChat initialized: Call
CometChatUIKit.init()before using components - User logged in: Call
CometChatUIKit.login()after initialization - Valid user/group: Ensure the
userorgroupinput is a valid CometChat object - Network connectivity: Check internet connection
- Console errors: Look for error messages in browser console
Why are real-time updates not working?
Why are real-time updates not working?
- Set
autoEstablishSocketConnection(true)in app settings - Check connection status:
CometChat.getConnectionStatus()should return'connected' - Verify the component is still mounted when expecting updates
How do I fix scroll jumping issues?
How do I fix scroll jumping issues?
- Set fixed dimensions on images
- Use
aspect-ratioCSS property - Implement placeholder loading states
How do I improve performance with large message histories?
How do I improve performance with large message histories?
- Reduce page size:
setLimit(20)instead of default 30 - Use
OnPushchange detection strategy - Implement lazy loading for media
- Clean up subscriptions in
ngOnDestroy - Avoid expensive computations in templates
CometChatMessageComposer
Common Issues
1. Messages not sending Ensure you have a valid user or group set:enterKeyBehavior setting:
Performance Tips
- Use OnPush Change Detection: The component uses
ChangeDetectionStrategy.OnPushfor optimal performance - Avoid Frequent Input Changes: Minimize unnecessary changes to
userorgroupinputs - Clean Up on Destroy: The component automatically cleans up listeners and timeouts on destroy
- Lazy Load Rich Text: Only enable
enableRichTextwhen needed
Message Bubbles
CometChatTextBubble
Link Previews Not Showing
Problem: Link preview cards are not displayed even though URLs are in the message. Solution: Link previews require metadata in a specific format. Ensure your message metadata follows this structure:Translation Not Displaying
Problem: Translated text is not showing even though translation metadata exists. Solution: Ensure the translation metadata is at the correct path:"translated_message" at the root level of the metadata object.
Mentions Not Formatting
Problem: @mentions appear as plain text without styling or interactivity. Solution: Ensure:- The message has mentioned users:
message.getMentionedUsers()returns an array - The mentioned users array contains valid CometChat.User objects
- The text contains the mention syntax (e.g.,
@username)
Read More Button Not Appearing
Problem: Long messages don’t show the read more button. Solution: The read more button only appears when content height exceeds 80 pixels (approximately 4 lines). Check:- The message text is actually long enough
- The component has finished rendering (ngAfterViewInit has been called)
- CSS is not overriding the height measurement
Custom Formatters Not Working
Problem: Custom text formatters are not being applied. Solution: Ensure your custom formatter:- Implements the
CometChatTextFormatterinterface - Returns a string from the
format()method - Is included in the
textFormattersarray input - Doesn’t throw exceptions (check console for errors)
Styling Not Applying
Problem: Custom CSS variables are not affecting the component’s appearance. Solution: Ensure:- CSS variables are defined on the
cometchat-text-bubbleselector or a parent element - Variable names match exactly (including the
--cometchat-prefix) - ViewEncapsulation is not preventing style inheritance
- CSS specificity is sufficient (use
::ng-deepfor deep styling if needed)
CometChatImageBubble
Images Not Displaying
Problem: Images are not showing even though the message has attachments. Solution: Ensure your message attachments have valid URLs:message.getAttachments()returns an array- Each attachment has a
urlproperty - URLs are accessible and not blocked by CORS
Gallery Viewer Not Opening
Problem: Clicking images doesn’t open the fullscreen gallery viewer. Solution: Check that:- The
imageClickevent is being emitted - No JavaScript errors in console
- The gallery viewer component is properly imported
- CSS for the gallery viewer is loaded
Overflow Indicator Not Showing
Problem: Messages with >4 images don’t show the “+N more” indicator. Solution: Verify:- The message actually has more than 4 attachments
- Localization key
image_bubble_overflow_moreexists in language files - CSS for overflow overlay is not being overridden
Caption Not Rendering
Problem: Caption text is not displayed below images. Solution: Ensure caption text exists in the message:Styling Not Applying
Problem: Custom CSS variables are not affecting the component’s appearance. Solution: Ensure:- CSS variables are defined on the
cometchat-image-bubbleselector or a parent element - Variable names match exactly (including the
--cometchat-prefix) - CSS specificity is sufficient (use
::ng-deepfor deep styling if needed)
CometChatVideoBubble
Video Thumbnails Not Displaying
Problem: Video thumbnails are not showing even though the message has video attachments. Solution: Ensure your message attachments have valid thumbnail URLs:message.getAttachments()returns an array- Each attachment has a
urlproperty for the video - Each attachment has a
thumbnailproperty for the preview image - URLs are accessible and not blocked by CORS
Video Player Not Opening
Problem: Clicking video thumbnails doesn’t open the fullscreen video player. Solution: Check that:- The
videoClickevent is being emitted - No JavaScript errors in console
- The video player component is properly imported
- CSS for the video player is loaded
- Video URL is valid and accessible
Duration Badge Not Showing
Problem: Duration badge is not displayed on video thumbnails. Solution: Verify:- The attachment has a
durationproperty in metadata - Duration is a valid number (in seconds)
- CSS for duration badge is not being overridden
Play Button Not Visible
Problem: Play button overlay is not visible on video thumbnails. Solution: Ensure:- CSS for play button overlay is loaded
- Play button icon asset is accessible
- CSS variables for play button colors are defined
- No CSS conflicts overriding the play button styles
Video Not Playing in Player
Problem: Video player opens but video doesn’t play. Solution: Check:- Video URL is valid and accessible
- Video format is supported by HTML5 video element
- No CORS issues blocking video playback
- Browser supports the video codec
Caption Not Rendering
Problem: Caption text is not displayed below videos. Solution: Ensure caption text exists in the message:Styling Not Applying
Problem: Custom CSS variables are not affecting the component’s appearance. Solution: Ensure:- CSS variables are defined on the
cometchat-video-bubbleselector or a parent element - Variable names match exactly (including the
--cometchat-prefix) - CSS specificity is sufficient (use
::ng-deepfor deep styling if needed)
CometChatAudioBubble
Audio Not Playing
Problem: Clicking the play button doesn’t start audio playback. Solution: Check that:- The audio URL is valid and accessible
- No CORS issues blocking audio loading
- WaveSurfer has finished loading (check loading state)
- No JavaScript errors in console
Waveform Not Displaying
Problem: The waveform visualization is not showing. Solution: Verify:- The audio file is accessible and not blocked by CORS
- The audio format is supported (MP3, WAV, OGG, etc.)
- WaveSurfer container element exists in the DOM
- No CSS hiding the waveform container
Download Not Working
Problem: Clicking the download button doesn’t download the file. Solution: Check that:- Audio URL is valid and accessible
- No CORS issues blocking the fetch request
- Browser allows downloads from the domain
- Sufficient disk space for the download
Expand Indicator Not Showing
Problem: The +N indicator is not displayed for multiple audios. Solution: Verify:- The message actually has more than 1 attachment
- Attachments array length is greater than 1
- CSS for expand indicator is loaded
- No JavaScript errors in console
Caption Not Rendering
Problem: Caption text is not displayed below audios. Solution: Ensure caption text exists in the message:Styling Not Applying
Problem: Custom CSS variables are not affecting the component’s appearance. Solution: Ensure:- CSS variables are defined on the
cometchat-audio-bubbleselector or a parent element - Variable names match exactly (including the
--cometchat-prefix) - CSS specificity is sufficient (use
::ng-deepfor deep styling if needed)
Single Audio Player Not Working
Problem: Multiple audios play simultaneously instead of one at a time. Solution: This is handled automatically by the component. If multiple audios play:- Check that all audio bubbles are using the same component version
- Verify no custom play logic is bypassing the single player policy
- Check for JavaScript errors in console
CometChatFileBubble
Files Not Displaying
Problem: Files are not showing even though the message has attachments. Solution: Ensure your message attachments have valid data:message.getAttachments()returns an array- Each attachment has a
nameproperty - Each attachment has a
urlproperty - URLs are accessible and not blocked by CORS
File Icons Not Showing
Problem: File type icons are not displaying. Solution: Check that:- Icon assets exist in the
assets/directory - Icon paths in
FILE_TYPE_ICONSmapping are correct - No 404 errors in browser console for icon files
- CSS for icon display is not being overridden
Expand Indicator Not Showing
Problem: The +N indicator is not displayed for multiple files. Solution: Verify:- The message actually has more than 1 attachment
- Attachments array length is greater than 1
- CSS for expand indicator is loaded
- No JavaScript errors in console
Expand/Collapse Not Working
Problem: Clicking the expand indicator or collapse button doesn’t work. Solution: Check that:- No JavaScript errors in console
- Click event handlers are properly bound
- Component change detection is working (OnPush strategy)
- No CSS preventing clicks (z-index, pointer-events)
File Size Showing “Size unknown”
Problem: File size displays as “Size unknown” instead of actual size. Solution: Ensure attachment has size property:Caption Not Rendering
Problem: Caption text is not displayed below files. Solution: Ensure caption text exists in the message:Download Links Not Working
Problem: Clicking download links doesn’t download the file. Solution: Verify:- Attachment URL is valid and accessible
- No CORS issues blocking downloads
- Browser allows downloads from the domain
- URL points to actual file, not a redirect
Styling Not Applying
Problem: Custom CSS variables are not affecting the component’s appearance. Solution: Ensure:- CSS variables are defined on the
cometchat-file-bubbleselector or a parent element - Variable names match exactly (including the
--cometchat-prefix) - CSS specificity is sufficient (use
::ng-deepfor deep styling if needed)
Focus Not Preserved on Expand
Problem: Focus is lost when expanding the file list. Solution: This is handled automatically by the component. If focus is not preserved:- Check that the collapse button element exists in the DOM
- Verify no JavaScript errors in console
- Ensure ViewChild reference is working correctly
CometChatCollaborativeDocumentBubble
Document URL Not Extracted
Problem: The action button is disabled even though the message has document data. Solution: Verify the metadata structure:Banner Image Not Displaying
Problem: The banner image is not showing. Solution: Check that:- Banner image assets exist in the
assets/directory - Asset paths are correct (
Collaborative_Document_Light.png,Collaborative_Document_Dark.png) - No 404 errors in browser console
Button Not Responding
Problem: Clicking the button doesn’t open the document. Solution: Verify:- Document URL is valid and accessible
- No popup blocker preventing window.open
- No JavaScript errors in console
Styling Not Applying
Problem: Custom CSS variables are not affecting the component. Solution: Ensure:- CSS variables are defined on the component selector or parent element
- Variable names match exactly (including
--cometchat-prefix) - Use
::ng-deepfor deep styling if needed
CometChatCollaborativeWhiteboardBubble
Whiteboard URL Not Extracted
Problem: The action button is disabled even though the message has whiteboard data. Solution: Verify the metadata structure:Banner Image Not Displaying
Problem: The banner image is not showing. Solution: Check that:- Banner image assets exist in the
assets/directory - Asset paths are correct (
Collaborative_Whiteboard_Light.png,Collaborative_Whiteboard_Dark.png) - No 404 errors in browser console
Button Not Responding
Problem: Clicking the button doesn’t open the whiteboard. Solution: Verify:- Whiteboard URL is valid and accessible
- No popup blocker preventing window.open
- No JavaScript errors in console
Styling Not Applying
Problem: Custom CSS variables are not affecting the component. Solution: Ensure:- CSS variables are defined on the component selector or parent element
- Variable names match exactly (including
--cometchat-prefix) - Use
::ng-deepfor deep styling if needed
Calls
CometChatCallLogs
Call Logs Not Loading
Problem: The call logs list is empty or stuck in loading state. Solutions:- Verify CometChat SDK is initialized and the user is logged in
- Verify
CometChatUIKitCallsis initialized — call logs require the Calls SDK, not just the core Chat SDK - Check network connectivity
- Verify API credentials are correct
- Check browser console for error messages
Call Initiation Failing
Problem: Clicking the call button does not start a call or throws an error. Solutions:- Ensure
CometChatUIKitCallsis properly initialized before using the component - Verify the logged-in user has permission to initiate calls
- Check that the other party’s UID is valid
- If using
callButtonClickedhandler, ensure your custom logic handles errors
CometChatUIKitCalls Not Initialized
Problem: Error message indicatingCometChatUIKitCalls is not available.
Solutions:
- Ensure the
@cometchat/calls-sdk-javascriptpackage is installed - Initialize the Calls SDK before rendering the component:
Outgoing Call Overlay Not Showing
Problem: After clicking the call button, no outgoing call screen appears. Solutions:- If you have bound
(callButtonClicked), the component emits the event instead of auto-initiating. Remove the binding to use auto-initiation, or implement call initiation in your handler - Check that the component’s container has sufficient height — the overlay is absolutely positioned within the component
- Verify no CSS
overflow: hiddenon parent elements is clipping the overlay