pingdotgg / uploadthing

File uploads for modern web devs
https://uploadthing.com
MIT License
4.19k stars 312 forks source link

uploadthings working in localhost but not working in production in react: client version mismatch #1036

Open Nischal-Ad opened 6 days ago

Nischal-Ad commented 6 days ago

Provide environment information

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"}

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

juliusmarminge commented 2 days ago

your server logs should say what exact versions it detects