Unable to delete file stored on public.blob.vercel-storage.com

I need to delete a file that was uploaded to public.blob.vercel-storage.com, but I’m getting the error: “Error deleting file: Vercel Blob: No token found. Either configure the BLOB_READ_WRITE_TOKEN environment variable, or pass a token option to your calls.”

Hi,

Are you delete the file programatically using SDK or via dashboard? Can you share more details such as screenshot of the error, type of file etc?

Trying to delete using this code

import { del } from '@vercel/blob';

async function deleteBlob() {
  const url = 'https://abc.public.blob.vercel-storage.com/aaa-1-xyz.csv';

  try {
    console.log(`Attempting to delete file: ${url}`);
    await del(url);
    console.log('File deleted successfully!');
  } catch (error) {
    console.error('Error deleting file:', error.message);
  }
}

deleteBlob();

Attempting to delete file: https://abc.public.blob.vercel-storage.com/aaa-1-xyz.csv``Error deleting file: Vercel Blob: No token found. Either configure the BLOB_READ_WRITE_TOKENenvironment variable, or pass atoken option to your calls.

I am also open to deleting it via dashboard, however I am not able to figure out how to do that. If you can share the steps to delete via dashboard that will be great.

Hi @benevolentprop-gmail, thanks for sharing additional context. As the error says, do you have the BLOB_READ_WRITE_TOKEN environment variable configured?

I’d recommend giving this guide a read to understand how to use the Vercel Blob SDK.

You can also delete the file manually by going to your Vercel dashboard > Storage > Your Blob Store > Scroll down to Browser:

2 Likes

Thanks Anshuman. This blob was created when I was created in v0.dev and it doesn’t show up in my blob as it is not a part of project. Is there another way of deleting the blob that was created by my v0 chat?

I am encountering the same issue and I havent found a solution to this, neither has any solution been proposed by anyone at vercel/v0

were you able to figure a solution?

Hi @hatter-hatt3rlabsc, have you tried checking the file browser in the Storage tab? What do you see?