Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
cometchat avatar

Cometchat Angular Troubleshooting

  • 5 installs
  • 70 repo stars
  • Updated June 23, 2026
  • cometchat/cometchat-skills

Diagnose and fix CometChat Angular UI Kit v4 integration failures like CUSTOM_ELEMENTS_SCHEMA errors, missing assets, module imports, SSR, and v3-to-v4 upgrades.

About

Provides a triage flow and symptom-to-fix reference for CometChat Angular UI Kit v4 integration failures across NgModule and standalone setups. A developer uses it when a CometChat Angular chat integration renders broken components, throws unknown-element errors, or fails init/login.

  • Checks CUSTOM_ELEMENTS_SCHEMA presence in every module using <cometchat-*> tags
  • Verifies angular.json assets config so CometChat icons render

Cometchat Angular Troubleshooting by the numbers

  • 5 all-time installs (skills.sh)
  • Ranked #441 of 596 Debugging skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/cometchat/cometchat-skills --skill cometchat-angular-troubleshooting

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs5
repo stars70
Last updatedJune 23, 2026
Repositorycometchat/cometchat-skills

What it does

Diagnose and fix CometChat Angular UI Kit v4 integration failures like CUSTOM_ELEMENTS_SCHEMA errors, missing assets, module imports, SSR, and v3-to-v4 upgrades.

Files

SKILL.mdMarkdownGitHub ↗

Purpose

Teaches Claude how to diagnose and fix CometChat Angular UI Kit v4 integration failures. Covers every category of failure across NgModule and standalone component setups, with an up-front triage flow so Claude asks the right questions before assuming a fix.

Read `cometchat-angular-core` first — most "why doesn't this work" issues trace to the init/login/module setup explained there.

Ground truth: docs/ui-kit/angular/troubleshooting, docs/ui-kit/angular/getting-started, and first-hand failure modes from real integrations.

---

1. Triage — read project state before guessing

When the user reports a problem, gather facts before proposing a fix.

1a. Is CUSTOM_ELEMENTS_SCHEMA in every module that uses <cometchat-*> tags?

grep -r "CUSTOM_ELEMENTS_SCHEMA" src/

If missing from any module or standalone component that uses <cometchat-*> tags, Angular throws "Unknown element" errors. Every module/component needs it independently.

1b. Are the assets configured in angular.json?

grep -A5 '"assets"' angular.json | grep cometchat

If missing, icons render as broken images. The required entry:

{ "glob": "**/*", "input": "./node_modules/@cometchat/chat-uikit-angular/assets/", "output": "assets/" }

1c. Is init complete before any <cometchat-*> component renders?

grep -n "CometChatUIKit.init\|isReady\|APP_INITIALIZER" src/app/app.component.ts

Look for the init promise + isReady flag or APP_INITIALIZER. Components rendered before init completes produce blank output.

1d. Is UIKitSettingsBuilder used (not a flat object)?

grep -n "UIKitSettingsBuilder\|CometChatUIKit.init" src/

Angular requires UIKitSettingsBuilder from @cometchat/uikit-shared. A flat object passed to init() fails silently or throws a type error.

1e. Are CometChat components imported in the module?

grep -n "CometChatConversations\|CometChatMessages\|CometChatMessageList" src/app/app.module.ts

Every <cometchat-*> component must be imported in the module (or standalone component) where it's used.

1f. Is BrowserAnimationsModule imported?

grep "BrowserAnimationsModule" src/app/app.module.ts

Missing BrowserAnimationsModule causes runtime errors in components that use Angular animations.

---

2. Symptom → fix lookup tables

2a. Initialization + login

SymptomLikely causeFix
Components render nothing after logininit() not awaited before mountUse *ngIf="isReady" on the container; set isReady = true after init + login resolve
Blank screen, no errorsComponent rendered before init completedGate with *ngIf="isReady"
getLoggedinUser() returns nullLogin not called or session expiredCall CometChatUIKit.login({ uid }) after init resolves
Login fails: "UID not found"User doesn't exist in CometChatCreate via dashboard, SDK, or REST API. For dev, use cometchat-uid-1 through cometchat-uid-5
CometChatUIKit.init() fails silentlyInvalid APP_ID / REGION / AUTH_KEYRe-verify from dashboard → your app → Credentials
UIKitSettingsBuilder is not a constructorImported from wrong packageImport from @cometchat/uikit-shared, not @cometchat/chat-uikit-angular
Production build exposes Auth KeyUsing authKey in environment.prod.tsSwitch to server-minted auth tokens. See cometchat-angular-production

2b. Module / schema errors

SymptomLikely causeFix
'cometchat-conversations' is not a known elementMissing CUSTOM_ELEMENTS_SCHEMAAdd schemas: [CUSTOM_ELEMENTS_SCHEMA] to the module or standalone component
'cometchat-conversations' is not a known element (even with schema)Component not imported in the moduleImport CometChatConversations from @cometchat/chat-uikit-angular in the module's imports array
Can't bind to 'user' since it isn't a known propertyComponent not importedSame fix — import the component in the module
NullInjectorError: No provider for CometChatThemeServiceCometChatThemeService not availableIt's providedIn: 'root' — ensure AppModule is the root module. If using standalone bootstrap, ensure provideAnimations() is in providers.
BrowserAnimationsModule errorMissing animation moduleAdd BrowserAnimationsModule to AppModule imports

2c. Assets / icons

SymptomLikely causeFix
Icons show as broken images (404)Missing assets config in angular.jsonAdd the glob entry for @cometchat/chat-uikit-angular/assets/ to build.options.assets
Icons broken only in production buildAssets config present but outputPath differsVerify the output path in the assets config matches your production output directory
Icons broken after ng buildAssets not copied during buildRun ng build again after adding the assets config; check dist/assets/ for the icon files

2d. Layout / height issues

SymptomLikely causeFix
Conversation list / message list renders emptyContainer has no bounded heightWrap in <div style="height: 100vh;"> or <div style="flex: 1; overflow: hidden;">
Components collapse to zero heightParent is a display: block with no heightUse display: flex; flex-direction: column; height: 100vh on the parent
Message list doesn't scrollContainer doesn't have overflow: hiddenAdd overflow: hidden to the message list's container; the component handles its own internal scroll
Chat dialog too smallAngular Material dialog has no explicit sizeSet width and height on the dialog container or pass { width: '480px', height: '600px' } to MatDialog.open()
Sidebar chat panel has no heightSidenav content has no height constraintAdd height: 100% or height: 100vh to the sidenav content

2e. Angular Router integration

SymptomLikely causeFix
Chat route shows blankCometChat init not complete when route activatesUse APP_INITIALIZER or a route guard that waits for init
window.location.reload() after login breaks routingAnti-pattern — reload destroys Angular stateUse this.router.navigate(['/chat']) instead
Lazy-loaded chat module fails to initCometChatUIKit.init() called inside the lazy moduleMove init to APP_INITIALIZER at the root level
Route guard canActivate always returns falsegetLoggedinUser() called before initEnsure init completes before the guard runs (use APP_INITIALIZER)

2f. Theming

SymptomLikely causeFix
Theme overrides don't applysetPrimary() called in ngOnInit instead of constructorMove to constructor — palette must be set before first render
Dark mode doesn't switchsetMode() called once but not reactiveCall setMode() again when the user toggles; the service is reactive
Custom color shows as defaultColor not a valid CSS color stringUse valid CSS color values (#hex, rgb(), named colors)
[conversationsStyle] input has no effectStyle object not instantiated with new ConversationsStyle({...})Use new ConversationsStyle({...}) — don't pass a plain object

2g. Components

SymptomLikely causeFix
Slot view ([listItemView], [subtitleView], etc.) renders nothing@ViewChild reference not resolved yetEnsure @ViewChild is accessed after ngAfterViewInit, not ngOnInit
[onItemClick] callback not firingWrong binding syntax — using round bracketsUse [onItemClick]="myFn" (square brackets, Input callback), never (onItemClick)="myFn($event)" (round brackets)
[user] input has no effectPassing a UID string instead of CometChat.User instanceawait CometChat.getUser(uid) first, pass the resolved object
Conversations list empty but data existsWrong request builder filtersCheck [conversationsRequestBuilder] filters (tags, types, limits)
"Reply in Thread" option does nothingThread panel not wiredWire [onThreadRepliesClick]="myFn" on <cometchat-message-list> and render a thread panel — see cometchat-angular-components § 11
[onError] callback fires with "not initialized"Component rendered before initGate with *ngIf="isReady"

2h. Calling

SymptomLikely causeFix
Call buttons missing@cometchat/calls-sdk-javascript not installednpm install @cometchat/calls-sdk-javascript + rebuild
Incoming call UI doesn't show<cometchat-incoming-call> not mounted or listener not registeredRegister CometChat.addCallListener(...) in AppComponent.ngOnInit and mount <cometchat-incoming-call> at the app root
Call listener fires twiceListener registered in a component that gets destroyed and re-createdMove listener registration to AppComponent (root, never destroyed)

2i. Extensions

SymptomLikely causeFix
Polls option missing from composerExtension not enabled in dashboardcometchat features enable polls --json or toggle in dashboard → Features
Extension enabled but UI doesn't appearCached session — hard reload neededStop ng serve, clear browser cache, restart
Extension says enabled but auto_wired_in_uikit: falseNeeds .setExtensions([...]) on UIKitSettingsBuilderAdd new PollsExtension() etc. to the builder — see cometchat-angular-features § 2

2j. Production / auth tokens

SymptomLikely causeFix
login({ authToken }) fails: "user does not exist"User not created in CometChat before token mintCreate user server-side via REST API on your signup flow. See cometchat-angular-production § 6
Token endpoint returns 401Backend auth check failingVerify Authorization: Bearer <jwt> header is attached to the Angular HttpClient request
429 rate limit on token endpointMinting tokens too often (e.g. per component init)Cache client-side, reuse until expiry
CometChatUIKit.loginWithAuthToken not foundWrong API nameIt's CometChatUIKit.login({ authToken }) — same method as dev, different key

2k. SSR / Angular Universal

SymptomLikely causeFix
window is not defined during SSRCometChat uses browser APIsGuard with isPlatformBrowser(platformId) — see cometchat-angular-patterns § 7
document is not defined during SSRSame causeSame fix
Components render on server but throwCometChat components use browser APIsWrap <cometchat-*> tags with *ngIf="isBrowser"

---

3. Deep dives on common failures

3a. "The most common 'why is my chat blank' bug"

CometChat components fill 100% of their parent's height. If the parent has no bounded height, the components render at 0px and look empty.

Diagnostic:

# Check the parent container of the CometChat component
grep -B5 "cometchat-message-list\|cometchat-conversations" src/app/**/*.html

Look for the component's parent. One of these must be true:

  • Parent has height: 100vh or height: 100%
  • Parent is a flex column with the component getting flex: 1
  • Parent has an explicit height: Npx

Broken example:

<!-- ✗ WRONG — div has no height -->
<div>
  <cometchat-message-list [user]="selectedUser"></cometchat-message-list>
</div>

Fixed:

<!-- ✓ RIGHT -->
<div style="height: 100vh; display: flex; flex-direction: column;">
  <cometchat-message-list
    [user]="selectedUser"
    style="flex: 1; overflow: hidden;"
  ></cometchat-message-list>
</div>

3b. "Unknown element" errors for <cometchat-*> tags

Two separate fixes are both required:

1. Import the component in the module's imports array:

   import { CometChatConversations } from "@cometchat/chat-uikit-angular";
   @NgModule({ imports: [CometChatConversations] })

2. Add `CUSTOM_ELEMENTS_SCHEMA` to the module's schemas:

   import { CUSTOM_ELEMENTS_SCHEMA } from "@angular/core";
   @NgModule({ schemas: [CUSTOM_ELEMENTS_SCHEMA] })

Both are required. Missing either one produces the "Unknown element" error.

3c. Components render before init completes

The most reliable fix is APP_INITIALIZER (see cometchat-angular-patterns § 1). If not using APP_INITIALIZER, use *ngIf="isReady":

// app.component.ts
isReady = false;

ngOnInit(): void {
  CometChatUIKit.init(settings)
    .then(() => CometChatUIKit.getLoggedinUser())
    .then((user) => user || CometChatUIKit.login({ uid: "cometchat-uid-1" }))
    .then(() => (this.isReady = true))
    .catch(console.error);
}
<!-- app.component.html -->
<ng-container *ngIf="isReady">
  <router-outlet></router-outlet>
</ng-container>

---

4. v3 → v4 upgrade gotchas

If the user is upgrading from @cometchat/chat-uikit-angular@3, these are the common breakages.

v3v4Notes
CometChatTheme classCometChatThemeService (Angular DI)Theme is now an injectable service
CometChatConversationsWithMessages compositeStill available but configuration API changedCheck [conversationsConfiguration] + [messagesConfiguration] props
theme prop on componentsTheme via CometChatThemeService onlyPer-component theme prop removed
onClick callback namesonItemClick callback namesRenamed for consistency
CometChat.login(uid, authKey)CometChatUIKit.login({ uid })Object-form argument
Flat settings objectUIKitSettingsBuilderBuilder pattern required

Upgrade sequence

# 1. Update the main kit
npm install @cometchat/chat-uikit-angular@latest

# 2. Update peer packages
npm install @cometchat/uikit-elements@latest @cometchat/uikit-resources@latest @cometchat/uikit-shared@latest

# 3. Replace flat settings object with UIKitSettingsBuilder
# 4. Replace CometChatTheme class with CometChatThemeService injection
# 5. Rename onClick → onItemClick throughout templates
# 6. Add CUSTOM_ELEMENTS_SCHEMA to all modules (new requirement in v4)
# 7. Add assets config to angular.json (new requirement in v4)
# 8. Rebuild + test

---

5. Escalation — when the above doesn't solve it

1. Read the raw error. Angular errors are usually specific — "Can't bind to 'user'" is different from "NullInjectorError". 2. Check the browser console + Angular DevTools. Angular DevTools shows the component tree and change detection state. 3. Search the upstream docs MCP (cometchat-docs if installed). 4. If the issue is a kit bug, file at https://github.com/cometchat/cometchat-uikit-angular/issues with a minimal repro.

---

6. Hard rules (diagnostic best-practice)

1. Don't assume — triage first. § 1 gets the schema, assets, init state, and module imports before proposing a fix. 2. Don't suggest "try reinstalling node_modules" as a first step. Check the schema, assets config, and module imports first. 3. When recommending a rebuild, say why + what to rebuild. "ng build after adding assets config" is more useful than "try rebuilding." 4. Never guess a fix that requires code changes without first gathering facts.

---

Skill routing reference

SkillWhen to route
cometchat-angular-coreMost "doesn't work" bugs trace back here — init/login/module setup
cometchat-angular-componentsWrong input / slot view / request builder
cometchat-angular-placementBlank chat / bounded-height issues
cometchat-angular-patternsRoute guard, lazy loading, SSR, APP_INITIALIZER
cometchat-angular-themingTheme not applying, dark mode not switching
cometchat-angular-featuresCalls don't work, extension UI missing after enable
cometchat-angular-customizationFormatter not rendering, listener not firing, template not showing
cometchat-angular-production401 on token fetch, user-does-not-exist on login
cometchat-angular-troubleshootingThis skill — cross-category diagnosis + v3→v4 upgrade

Related skills

Debuggingfrontend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.