Skip to content

[bug]: 'UploadThingError' throw in 'onUploadComplete' not caught in 'onUploadError' #1271

@dwalker93

Description

@dwalker93

Provide environment information

System:
    OS: Windows 11 10.0.26200
    CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
    Memory: 13.49 GB / 23.88 GB
  Binaries:
    Node: 22.16.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.9.2 - C:\Program Files\nodejs\npm.CMD
    bun: 1.3.2 - C:\Users\perer\.bun\bin\bun.EXE
  Browsers:
    Chrome: 145.0.7632.160
    Edge: Chromium (143.0.3650.75)
  npmPackages:
    @uploadthing/react: ^7.3.3 => 7.3.3
    typescript: ^5 => 5.9.3
    uploadthing: ^7.7.4 => 7.7.4

Describe the bug

I'm tried to throw some custom errors using 'UploadThingError' in onUploadComplete after some custom checkups. But they are not throwing them to the frontend onUploadError function and hanging the UI loading state continuously. Can't we throw errors in onUploadComplete function?

Link to reproduction

https://github.com/dwalker93/uploadthing-onUploadComplete-test

To reproduce

Just clone the repo and run the project

Additional information

No response

👨‍👧‍👦 Contributing

  • 🙋‍♂️ Yes, I'd be down to file a PR fixing this bug!

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions