I hope I'm not too late. But I'll suggest a couple of changes.
- Use the new way to authorise uploadThing. REFERENCE HERE
- Pass some props on your component. REFERENCE HERE
On your index.js line 14 (your config), use the new way to authenticate uploadthing. You can get that token on your uploadThing Project under API Keys Tab.
uploadThing Menu for Ref
config: {
token: UPLOADTHING_TOKEN,
}
On your App.jsx your Button component need some props to understand and link everything.
<UploadButton
endpoint="imageUploader"
onClientUploadComplete={res => console.log(res)}
onUploadError={err => console.error(err)}
config={{mode: "manual"}
/>
Only the endpoint is necessary, the other props is more to give you a feedback on what's going on with your upload.
the endpoint must match the setting you called on your uploadthing.js ( line 6 ) on your case "imageUploader"
And the config={{mode: "manual"}} is a personal preference. Without it the file will be automatically upload. With it, requires a confirmation click.
Last, when posting questions try to post your code snippets as well. It's a bit a of a pain to keep jumping back and forth from screenshot links. A snippet people can just copy make the changes and send you back.