Error when using uploadthig uploadFilesFromUrl

I'm getting this error when uploading an image url to uploadthing
Failed to set fetch cache URL {
href: 'https://oaidalleapiprodscus.blob.core.windows.net/tje rest of the url...',
origin: 'https://oaidalleapiprodscus.blob.core.windows.net',
protocol: 'https:',
username: '',
password: '',
host: 'oaidalleapiprodscus.blob.core.windows.net',
hostname: 'oaidalleapiprodscus.blob.core.windows.net',
port: '',
pathname: '...',
search: '...',
searchParams: URLSearchParams {
'st' => '2023-12-29T05:54:21Z',
'se' => '2023-12-29T07:54:21Z',
'sp' => 'r',
'sv' => '2021-08-06',
'sr' => 'b',
'rscd' => 'inline',
'rsct' => 'image/png',
'skoid' => '6aaadede-4fb3-4698-a8f6-684d7786b067',
'sktid' => 'a48cca56-e6da-484e-a814-9c849652bcb3',
'skt' => '2023-12-28T19:40:17Z',
'ske' => '2023-12-29T19:40:17Z',
'sks' => 'b',
'skv' => '2021-08-06',
'sig' => 'KPdiC62CmhmwSuk7I7McHsMknbd+iqZU2q76J3oecfI=' },
hash: ''
} Error: fetch for over 2MB of data can not be cached
at IncrementalCache.set (/home/seif/lego-ai/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/lib/incremental-cache/index.js:381:23)
at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/lib/patch-fetch.js:397:74)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Failed to set fetch cache URL {
href: 'https://oaidalleapiprodscus.blob.core.windows.net/tje rest of the url...',
origin: 'https://oaidalleapiprodscus.blob.core.windows.net',
protocol: 'https:',
username: '',
password: '',
host: 'oaidalleapiprodscus.blob.core.windows.net',
hostname: 'oaidalleapiprodscus.blob.core.windows.net',
port: '',
pathname: '...',
search: '...',
searchParams: URLSearchParams {
'st' => '2023-12-29T05:54:21Z',
'se' => '2023-12-29T07:54:21Z',
'sp' => 'r',
'sv' => '2021-08-06',
'sr' => 'b',
'rscd' => 'inline',
'rsct' => 'image/png',
'skoid' => '6aaadede-4fb3-4698-a8f6-684d7786b067',
'sktid' => 'a48cca56-e6da-484e-a814-9c849652bcb3',
'skt' => '2023-12-28T19:40:17Z',
'ske' => '2023-12-29T19:40:17Z',
'sks' => 'b',
'skv' => '2021-08-06',
'sig' => 'KPdiC62CmhmwSuk7I7McHsMknbd+iqZU2q76J3oecfI=' },
hash: ''
} Error: fetch for over 2MB of data can not be cached
at IncrementalCache.set (/home/seif/lego-ai/node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/lib/incremental-cache/index.js:381:23)
at eval (webpack-internal:///(rsc)/./node_modules/.pnpm/[email protected][email protected][email protected]/node_modules/next/dist/server/lib/patch-fetch.js:397:74)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
1 Reply
3eif
3eifOP11mo ago
Code:
"use server";

import OpenAI from "openai";
import { UTApi } from "uploadthing/server";

const utapi = new UTApi();

const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY ?? "",
});

export async function generateLegoSet(formData: FormData) {
....
const dalleImageUrl = image.data[0].url; // i get this from somewhere
const imageUrl = await utapi.uploadFilesFromUrl([dalleImageUrl!]);
}
"use server";

import OpenAI from "openai";
import { UTApi } from "uploadthing/server";

const utapi = new UTApi();

const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY ?? "",
});

export async function generateLegoSet(formData: FormData) {
....
const dalleImageUrl = image.data[0].url; // i get this from somewhere
const imageUrl = await utapi.uploadFilesFromUrl([dalleImageUrl!]);
}
Want results from more Discord servers?
Add your server