ποΈ task - fix(types): export HelpfulErrorMetadata from the package index β subclass authors cannot name the constraint
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 92/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- api, developer-experience
Research direction
Start in src/index.ts, where HelpfulError and type HelpfulErrorCode are exported, and add HelpfulErrorMetadata beside them. Check the subclass pattern described in the issue to confirm the type is importable from the package entry point; a README note about subclassing is an optional follow-up.
Written by the indexing model from the issue text.
Description
π¦«ποΈ dispatch to foreman
π§ task enqueued
ββ priority = ?
ββ yieldage = ?
ββ leverage = ?
title
fix(types): export HelpfulErrorMetadata from the package index β subclass authors cannot name the constraint
description
what
add type HelpfulErrorMetadata to the package index export, beside HelpfulErrorCode.
why
HelpfulError and every subclass are generic over TMetadata extends HelpfulErrorMetadata. a consumer that declares its own subclass MUST name that constraint:
export class UnauthorizedRequestError<
TMetadata extends HelpfulErrorMetadata = HelpfulErrorMetadata, // <- unnameable
> extends BadRequestError<TMetadata> { ... }
but src/index.ts exports HelpfulError and type HelpfulErrorCode, and NOT HelpfulErrorMetadata. so the one type a subclass author needs is the one type they cannot import. the two workarounds are both poor: reach into helpful-errors/dist/HelpfulError (past the public entry into a build artifact), or redeclare Record<string, any> & { cause?: Error } locally (drifts). svc-gateway took a third route β type HelpfulErrorMetadata = NonNullable<HelpfulError["metadata"]> β which works but is a puzzle for a type the package already has.
why it bites
HelpfulError.throw binds this: T extends typeof HelpfulError, reading the constructor return type. a non-generic subclass returns HelpfulError<HelpfulErrorMetadata> where HelpfulError<TMetadata> is demanded, so .throw becomes unreachable (TS2684). the fix is to make the subclass generic β which needs the unexported constraint. so the gap blocks the documented subclass pattern.
ask
add type HelpfulErrorMetadata to the index export. one line. worth a readme note too, since subclasses are a first-class use of this package.
source
found during the declapract upgrade of ahbode/svc-gateway (branch vlad/bump-practs), item 8 of .dream/2026_08_12.upstream-sdk-zod-glossary-splits
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up β it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Similar issues
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 Β·
-
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 Β·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100