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.
The error-handling docs recommend
instanceofnarrowing onUpupError/UpupValidationErrorand switching onUpupErrorCode, but those are only exported from@upupjs/core. Neither@upupjs/reactnor@upupjs/nextre-exports them:(checked against 3.1.0)
So every app that wants typed error handling has to add a direct dependency on
@upupjs/coreeven though it only installed the framework package. We hit this in three separate apps during migration — each one ended up with@upupjs/corein its package.json just for the error classes.Since
@upupjs/nextalready doesexport * from '@upupjs/react', re-exporting the error classes andUpupErrorCodefrom@upupjs/reactwould fix all packages at once. Alternatively, document that core is a required peer for typed error handling.