generateUploadButton throws type error
I'm following the 0 - Production Tutorial. I am about an hour in, and adding the upload button for UploadThing.
In the first attachment you can see the code to create a custom export component using the generateUploadButton function. Calling it like this throws the error in attachment 2. If I replace
OurFileRouter
with FileRouter
nothing changes, making me believe that OurFileRouter
is not part of the problem.
When I Import UploadButton
from @uploadthing/react
(with alias) and directly export it. As the commented out line does. The code works.
Can someone give me some pointers where reality diverted from the tutorial and how to start to debug this issue?

1 Reply
Add the
"use client";
directive to the topnav.tsx
file. It is added in the tutorial as well, a few mins later.
However, why it immediately fails for us and does not break for Theo I don't understand.
The uploadthing docs mentions "use client";
directive in a red warning note as well. These posts discuss the same issue and come to the same conclusion -
https://discord.com/channels/966627436387266600/1319489814831304724
https://discord.com/channels/966627436387266600/1294811267713859675