Open prpanto opened 1 month ago
I ran into this as well. IIRC, you need to set a logLevel in your Nuxt config:
export default defineNuxtConfig({
devtools: { enabled: true },
modules: ["@uploadthing/nuxt"],
compatibilityDate: "2024-07-26",
+ uploadthing: {
+ logLevel: "info",
+ },
});
I add it and I have these messages:
Hmm I am able to reproduce that locally as well. If you set config: { mode: 'manual' }
in your component:
<UploadButton
:config="{
endpoint: 'imageUpload',
onClientUploadComplete(response) {
console.log(`onClientUploadComplete`, response);
alert('Upload Completed');
response[0]?.serverData;
},
onUploadBegin: () => {
console.log(`onUploadBegin`);
},
config: { mode: 'manual' },
}"
/>
Does it still fail with a 500?
Hmm I am able to reproduce that locally as well. If you set
config: { mode: 'manual' }
in your component:<UploadButton :config="{ endpoint: 'imageUpload', onClientUploadComplete(response) { console.log(`onClientUploadComplete`, response); alert('Upload Completed'); response[0]?.serverData; }, onUploadBegin: () => { console.log(`onUploadBegin`); }, config: { mode: 'manual' }, }" />
Does it still fail with a 500?
Now works...
How to make it to upload automatically without the option manual because right now it wants two clicks?
Ok, that was what I was worried about. This is definitely a bug.
You can try using this canary version: @uploadthing/nuxt@6.5.10-canary.01a466a
Note: I believe you will need to add an override for @uploadthing/vue@6.6.4-canary.01a466a
as well.
Provide environment information
Describe the bug
I use a fresh Nuxt project with version 3.12.4 @uploadthing/nuxt: 6.5.9 uploadthing: 6.13.2
just copy paste the code from playground example of Nuxt and then on upload file this error show.
Link to reproduction
https://stackblitz.com
To reproduce
Additional information
No response
👨👧👦 Contributing
Code of Conduct