Skip to content

UpupError / UpupErrorCode not re-exported from @upupjs/react or @upupjs/next #339

Description

@BSalaeddin

The error-handling docs recommend instanceof narrowing on UpupError / UpupValidationError and switching on UpupErrorCode, but those are only exported from @upupjs/core. Neither @upupjs/react nor @upupjs/next re-exports them:

> require('@upupjs/react').UpupError
undefined

(checked against 3.1.0)

So every app that wants typed error handling has to add a direct dependency on @upupjs/core even though it only installed the framework package. We hit this in three separate apps during migration — each one ended up with @upupjs/core in its package.json just for the error classes.

Since @upupjs/next already does export * from '@upupjs/react', re-exporting the error classes and UpupErrorCode from @upupjs/react would fix all packages at once. Alternatively, document that core is a required peer for typed error handling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions