"Expected an error object to be thrown." At From 0 to Production - The Modern React Tutorial

Hi, I was watching Theo's "From 0 to Production - The Modern React Tutorial (RSCs, Next.js, Shadui, Drizzle, TS and more)" and at 55:35, he was implementing UploadThing to the app and I had an error at if (!user.userId) throw new UploadThingError("Unauthorized"); and I couldn't fix it. I am using VSCode's ESLint Plugin and it gave me this error. "Expected an error object to be thrown." I have no idea how to fix it. Can anyone help me? Thanks a lot!
No description
3 Replies
test_1
test_14mo ago
I have the same issue
MUG Knight
MUG Knight3mo ago
Same issue. I assumed UploadThingError extends an Error object, but that appears to be inocrrect. The "simple" solution is to just throw a regular Error object.
bakdaddy
bakdaddy3mo ago
I'm not really familair with the tutorial (yet) but you could try to pass "as Error" at the end of the line 17
Want results from more Discord servers?
Add your server