Theo's Typesafe CultTTC
Theo's Typesafe Cult2y ago
17 replies
Fagner

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)


uploadthing: ^6.10.1
bun: 1.1.3
Was this page helpful?