Failed to parse response from UploadThing server

I get this error when uploading a picture after deployment. It works perfectly fine on my local dev server /api/uploadthing/route.ts
import { createRouteHandler } from "uploadthing/next";

import { ourFileRouter } from "./core";

export const { GET, POST } = createRouteHandler({
router: ourFileRouter,
});

export const runtime = "nodejs";
import { createRouteHandler } from "uploadthing/next";

import { ourFileRouter } from "./core";

export const { GET, POST } = createRouteHandler({
router: ourFileRouter,
});

export const runtime = "nodejs";
How I invoke the component:
"use client";

import { ourFileRouter } from "@/app/api/uploadthing/core";
import { UploadDropzone } from "@/lib/uploadthing";
import toast from "react-hot-toast";

interface FileUploadProps {
onChange: (url?: string) => void;
endpoint: keyof typeof ourFileRouter;
}

const FileUpload = ({ endpoint, onChange }: FileUploadProps) => {
return (
<UploadDropzone
endpoint={endpoint}
onClientUploadComplete={(res) => {
console.log("upload thing checkpoint", res);
console.log("object", res?.[0].url);
onChange(res?.[0].url);
}}
onUploadError={(error: Error) => {
toast.error(`${error?.message}`);
}}
/>
);
};

export default FileUpload;
"use client";

import { ourFileRouter } from "@/app/api/uploadthing/core";
import { UploadDropzone } from "@/lib/uploadthing";
import toast from "react-hot-toast";

interface FileUploadProps {
onChange: (url?: string) => void;
endpoint: keyof typeof ourFileRouter;
}

const FileUpload = ({ endpoint, onChange }: FileUploadProps) => {
return (
<UploadDropzone
endpoint={endpoint}
onClientUploadComplete={(res) => {
console.log("upload thing checkpoint", res);
console.log("object", res?.[0].url);
onChange(res?.[0].url);
}}
onUploadError={(error: Error) => {
toast.error(`${error?.message}`);
}}
/>
);
};

export default FileUpload;
Error Message: Failed to parse response from UploadThing server
No description
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server