Fagner
Fagner
TTCTheo's Typesafe Cult
Created by Fagner on 5/2/2024 in #questions
UploadThing in a backend application
I'm trying to use uploadthing in my Discord Bot, since I don't have any routing or anything complex, I thought that using UTAPI SDK would be enough, but I'm facing a weird error. Whenever I try to use any method provided by UTApi errors with (FiberFailure) TypeError: Attempted to assign to readonly property. Full Error:
$ turbo dev --filter discord-bot
• Packages in scope: discord-bot
• Running dev in 1 packages
• Remote caching disabled
discord-bot:dev: cache bypass, force executing 79077e2ea62107d1
discord-bot:dev: $ bun --watch src/index.ts
discord-bot:dev: 937 | ...options,
discord-bot:dev: 938 | type: options?.type ?? (lookup(name) || "application/octet-stream"),
discord-bot:dev: 939 | lastModified: options?.lastModified ?? Date.now()
discord-bot:dev: 940 | };
discord-bot:dev: 941 | super(parts, optionsWithDefaults);
discord-bot:dev: 942 | this.name = name;
discord-bot:dev: ^
discord-bot:dev: (FiberFailure) TypeError: Attempted to assign to readonly property.
discord-bot:dev: at new UTFile (/home/fagner/code/dogbux/dogbux/node_modules/uploadthing/server/index.js:942:13)
discord-bot:dev: at /home/fagner/code/dogbux/dogbux/node_modules/uploadthing/server/index.js:1033:95
discord-bot:dev: at /home/fagner/code/dogbux/dogbux/node_modules/effect/dist/esm/internal/core.js:409:39
discord-bot:dev: at runLoop (/home/fagner/code/dogbux/dogbux/node_modules/effect/dist/esm/internal/fiberRuntime.js:1063:28)
discord-bot:dev: at evaluateEffect (/home/fagner/code/dogbux/dogbux/node_modules/effect/dist/esm/internal/fiberRuntime.js:696:27)
discord-bot:dev: at evaluateMessageWhileSuspended (/home/fagner/code/dogbux/dogbux/node_modules/effect/dist/esm/internal/fiberRuntime.js:671:16)
discord-bot:dev: at drainQueueOnCurrentThread (/home/fagner/code/dogbux/dogbux/node_modules/effect/dist/esm/internal/fiberRuntime.js:452:85)
discord-bot:dev: at /home/fagner/code/dogbux/dogbux/node_modules/effect/dist/esm/internal/fiberRuntime.js:1090:10
discord-bot:dev: at starveInternal (/home/fagner/code/dogbux/dogbux/node_modules/effect/dist/esm/Scheduler.js:73:15)
$ turbo dev --filter discord-bot
• Packages in scope: discord-bot
• Running dev in 1 packages
• Remote caching disabled
discord-bot:dev: cache bypass, force executing 79077e2ea62107d1
discord-bot:dev: $ bun --watch src/index.ts
discord-bot:dev: 937 | ...options,
discord-bot:dev: 938 | type: options?.type ?? (lookup(name) || "application/octet-stream"),
discord-bot:dev: 939 | lastModified: options?.lastModified ?? Date.now()
discord-bot:dev: 940 | };
discord-bot:dev: 941 | super(parts, optionsWithDefaults);
discord-bot:dev: 942 | this.name = name;
discord-bot:dev: ^
discord-bot:dev: (FiberFailure) TypeError: Attempted to assign to readonly property.
discord-bot:dev: at new UTFile (/home/fagner/code/dogbux/dogbux/node_modules/uploadthing/server/index.js:942:13)
discord-bot:dev: at /home/fagner/code/dogbux/dogbux/node_modules/uploadthing/server/index.js:1033:95
discord-bot:dev: at /home/fagner/code/dogbux/dogbux/node_modules/effect/dist/esm/internal/core.js:409:39
discord-bot:dev: at runLoop (/home/fagner/code/dogbux/dogbux/node_modules/effect/dist/esm/internal/fiberRuntime.js:1063:28)
discord-bot:dev: at evaluateEffect (/home/fagner/code/dogbux/dogbux/node_modules/effect/dist/esm/internal/fiberRuntime.js:696:27)
discord-bot:dev: at evaluateMessageWhileSuspended (/home/fagner/code/dogbux/dogbux/node_modules/effect/dist/esm/internal/fiberRuntime.js:671:16)
discord-bot:dev: at drainQueueOnCurrentThread (/home/fagner/code/dogbux/dogbux/node_modules/effect/dist/esm/internal/fiberRuntime.js:452:85)
discord-bot:dev: at /home/fagner/code/dogbux/dogbux/node_modules/effect/dist/esm/internal/fiberRuntime.js:1090:10
discord-bot:dev: at starveInternal (/home/fagner/code/dogbux/dogbux/node_modules/effect/dist/esm/Scheduler.js:73:15)
uploadthing: ^6.10.1 bun: 1.1.3
18 replies
TTCTheo's Typesafe Cult
Created by Fagner on 4/20/2024 in #questions
shadcn's form with uploadthing sdk
I am trying to upload an image to UploadThing through the SDK inside a server action. But I'm not sure how to fulfill the uploadFiles parameters because I'm not receiving a FormData from the form. My idea was to parse the image to base64 before sending to the server and then uploading it (that's what I usually do in my local projects) but I actually don't know how to pass base64 to be uploaded.
7 replies
TTCTheo's Typesafe Cult
Created by Fagner on 7/5/2023 in #questions
Pull template repository
I would like to know if it is possible to use a template repository and after the template repo receives changes if I can "pull" to add the news changes to my personal repo just like reinstalling a library
6 replies