[PUT] Asset returns "Cannot overwrite generated asset"

Ivailo_Hristov
New Member
4 0 0

Hi, I am getting this error "Cannot overwrite generated asset <asset_key>" when trying to update a JS file in a theme through the API. Do you have any idea why that may be happening and how to fix it? I couldn't find any documentation about this error and even a Google search returns less than 1 full page of results :(

Thanks!

0 Likes
Busfox
Shopify Staff
Shopify Staff
619 48 94

Hi there,

Some theme assets are automatically generated by Shopify and cannot be updated through the API like other assets. When you attempt to do so, you are given the error that you are seeing.

Cheers,

0 Likes
Ivailo_Hristov
New Member
4 0 0

Thanks

0 Likes
Seahawksean
Tourist
13 0 0

But if the said file (in my case theme.scss) is generated by Shopify and cannot be updated manually, then why do we have access to it?  And how can it be deleted if it's generated from within Shopify only?

I was trying to set up a local dev environment and mistakenly deleted this theme.scss file in my local directory which automatically removed it from my Assets folder in Shopify. I'm trying to get it back into my Assets folder because it contains all my styling variables, but this error is keeping me from doing so. 

Any insight into this?

0 Likes