Error helpers in errors.ts (isAPIError, isErrorRetryable, APIErrorCodes) are not exported from the package entry point

Aperta Adatta ai principianti
#1,848 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Tyagiquamar ci sta già lavorando.

Dal 13/9/2026.

  • #1864 di @Tyagiquamar — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
api

Direzione di ricerca

Inizia da src/index.ts e confronta i suoi export con gli helper già esportati da src/errors.ts. Verifica l’entry point del package e gli output ESM/types generati, quindi esegui i controlli di test o build pertinenti. Il lavoro è completato quando gli helper degli errori documentati e APIErrorCodes possono essere importati da stream-chat senza il fallimento di Turbopack né export silenziosamente undefined.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

src/errors.ts exports APIErrorCodes (with per-code retryable flags), isAPIError, isErrorRetryable, and isConnectionIDError, but src/index.ts never re-exports the module, so none of them are importable from stream-chat (verified on 9.51.0 and current master).

Meanwhile ErrorFromResponse from the same module is publicly reachable, and dist/types/errors.d.ts ships in the package — so TS tooling happily autocompletes the helpers, and the failure only surfaces at build time:

Error: Export isAPIError doesn't exist in target module
The export isAPIError was not found in module [project]/node_modules/stream-chat/dist/esm/index.mjs [app-client] (ecmascript).
All exports of the module are statically known (It doesn't have dynamic exports).

(Turbopack / Next.js 16, statically analyzed ESM. Runtimes with looser CJS interop resolve the import to undefined instead, which is arguably worse since it fails silently.)

Use case: implementing an app-level send-retry policy that fails fast on non-retryable API errors (validation, message-too-long, permissions) while retrying retryable ones (rate limit, timeout). The SDK already encodes exactly this knowledge in APIErrorCodes, but integrators currently have to copy the table into app code to use it.

Would you accept adding export * from './errors' (or a curated subset) to src/index.ts?

Lingua principale
TypeScript
Stelle
211
Fork
84
Merge medio
1g 2h
PR unite (30g)
89

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GetStream/stream-chat-js

Tutte le issue di GetStream/stream-chat-js

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.