TotallyDarkT
Convex Community2y ago
7 replies
TotallyDark

Pushing Generated PNG to Convex DB

Hi, so I have a png image that I want to push to my Convex DB, I am following this tutorial to do so: https://docs.convex.dev/file-storage/store-files. However, when importing the image to my .ts file trying to store in my by database with following code

import img from '../TodayImg.png'
const image = await img.blob();
const storageId: Id<"_storage"> = await ctx.storage.store(image)

(attatched code and error message)

I am getting a "No loader is configured for ".png" files" error. Does anyone know how I can fix this?
UploadTSCode.png
convexdeverror.png
Was this page helpful?