Found while adding per-file retry to a failed upload tile in a host app (@upupjs/react 3.2.0, re-exported verbatim by @upupjs/next).
What exists internally
- The controller implements
retryUpload(fileId) (dist/index.js ~L3741) and puts it on the context as providerValues.upload.retryUpload (~L3897).
useUploaderUploadControls() exposes upload.retryUpload; the vendor's own upup-retry-btn calls it (~L2506).
What a host can reach
UploaderRef (index.d.ts L8) is { useUpload() } → { error, files, loading, progress, upload, resetState, uploadFiles, setFiles, replaceFiles }. No retryUpload, no core, no on.
useUpload() (~L3944) receives the controller's retryUpload but forwards only startUpload.
useUploaderUploadControls() resolves only inside UploaderContextProvider, and <UpupUploader> renders fixed children (no children prop), so a host cannot mount anything inside the provider.
onError is (message: string) => void: no per-file error callback. FileUploadResult{status:'failed', error} and the 'upload-error': {error, file?} core event are only readable through the headless core/on, i.e. by abandoning the visual uploader.
Ask
Forward retryUpload from useUpload() (one line) so UploaderRef.useUpload().retryUpload(fileId) works, and/or add a per-file failure callback (onFileUploadError?: (file: File, error: string) => void) next to onFileUploadStart/onFileUploadComplete.
Workaround shipped on the host side meanwhile: keep the raw File from onFileUploadStart and re-enter it through initialFiles → uploadFiles, re-keying the tile by File identity because a fresh core assigns a new id.
Found while adding per-file retry to a failed upload tile in a host app (@upupjs/react 3.2.0, re-exported verbatim by @upupjs/next).
What exists internally
retryUpload(fileId)(dist/index.js~L3741) and puts it on the context asproviderValues.upload.retryUpload(~L3897).useUploaderUploadControls()exposesupload.retryUpload; the vendor's ownupup-retry-btncalls it (~L2506).What a host can reach
UploaderRef(index.d.tsL8) is{ useUpload() }→{ error, files, loading, progress, upload, resetState, uploadFiles, setFiles, replaceFiles }. NoretryUpload, nocore, noon.useUpload()(~L3944) receives the controller'sretryUploadbut forwards onlystartUpload.useUploaderUploadControls()resolves only insideUploaderContextProvider, and<UpupUploader>renders fixed children (nochildrenprop), so a host cannot mount anything inside the provider.onErroris(message: string) => void: no per-file error callback.FileUploadResult{status:'failed', error}and the'upload-error': {error, file?}core event are only readable through the headlesscore/on, i.e. by abandoning the visual uploader.Ask
Forward
retryUploadfromuseUpload()(one line) soUploaderRef.useUpload().retryUpload(fileId)works, and/or add a per-file failure callback (onFileUploadError?: (file: File, error: string) => void) next toonFileUploadStart/onFileUploadComplete.Workaround shipped on the host side meanwhile: keep the raw
FilefromonFileUploadStartand re-enter it throughinitialFiles→uploadFiles, re-keying the tile byFileidentity because a fresh core assigns a new id.