NextJS | Uploading image to R2 storage issue.

Hello, I am trying to upload image to R2 storage, I use nextjs.
Error uploading to R2: Error: [unenv] fs.readFile is not implemented yet!

const putObjectCommand = new PutObjectCommand({
        Bucket: R2_CONFIG.bucketName,
        Key: file.name,
        Body: buffer,
        ContentType: file.type,
    });
await r2Client.send(putObjectCommand);
Was this page helpful?