import { createUploadthing, type FileRouter } from 'uploadthing/express';
const f = createUploadthing();
export const uploadRouter = {
imageUploader: f({
image: {
maxFileSize: '16MB',
maxFileCount: 10,
},
})
.onUploadError((e) => {
throw 'There is something problem while uploading the image! please try again later.';
})
.onUploadComplete((data) => {
console.log('upload completed');
}),
} satisfies FileRouter;
export type OurFileRouter = typeof uploadRouter;
<UploadButton
endpoint="imageUploader"
onClientUploadComplete={(e) => {
setImage(e?.[0]?.url)
setLoading(false)
}}
onUploadError={() => {
notifyError(
'Something went wrong while uploading the image! Please try again.'
)
setLoading(false)
}}
onUploadAborted={() => setLoading(false)}
onUploadBegin={() => setLoading(true)}
/>
Describe the bug
I am using "uploadthing": "^7.1.0", package at both frontend and backend and it works fine in localhost i can upload image but while in production it says client version mismatch
{"message":"Client version mismatch"}
Provide environment information
Describe the bug
I am using "uploadthing": "^7.1.0", package at both frontend and backend and it works fine in localhost i can upload image but while in production it says client version mismatch
{"message":"Client version mismatch"}
Link to reproduction
https://rental-frontend-lvq3.onrender.com/services
To reproduce
goto: services-> add vehicle-> add image
Additional information
No response
๐จโ๐งโ๐ฆ Contributing
Code of Conduct