CLI errors: failed to delete file

I ran the command shopify theme dev --store colorrave in terminal and I am getting the following errors from the CLI:

Failed to delete file “templates/gift_card.liquid” from remote theme.

Failed to delete file “config/settings_data.json” from remote theme.

Failed to delete file “config/settings_schema.json” from remote theme.

@o-t-w This error is fairly common when using shopify theme dev — it usually happens when the Shopify CLI tries to sync files that are not deletable or protected on the remote theme. Let’s break it down:


:magnifying_glass_tilted_right: Why It Happens

  1. Protected Files
    Some files (like gift_card.liquid, settings_data.json, settings_schema.json) are system-managed. The CLI doesn’t let you delete them directly because they are required by Shopify.

  2. Sync Conflicts
    If the local copy is missing these files but the remote theme has them, the CLI tries to delete them remotely → fails because Shopify blocks deletion.

  3. Permissions/Theme Differences
    If you’re not working on the development theme copy, or if the theme is locked, these errors can show up.


:white_check_mark: Solutions

  1. Make Sure You’re on a Development Theme
    Run:

    shopify theme list
    
    

    Look for a theme marked as [development]. If you’re pushing to a live/published theme, switch to a dev copy instead.

    shopify theme dev --store=colorrave
    
    
  2. Re-download the Theme with All Files
    If your local theme is missing those files, pull everything fresh:

    shopify theme pull --store=colorrave
    
    

    This will sync system files too, so they’re not treated as “missing” locally.

  3. Ignore These Errors if Everything Else Works
    These particular files (gift_card.liquid, settings_data.json, settings_schema.json) are system-protected and won’t block theme development. You can safely ignore those warnings if all other changes sync fine.

  4. Optional: Use --ignore
    If the errors annoy you, you can ignore specific paths by adding them to .shopifyignore in your theme folder:

    templates/gift_card.liquid
    config/settings_data.json
    config/settings_schema.json
    
    

So in short: nothing is broken Shopify just won’t let the CLI delete those system-managed files. The fix is either to pull the full theme once, or ignore the errors going forward.

Hi @o-t-w

This is a common issue that arises from a protective measure within Shopify. To prevent the accidental deletion of crucial theme settings and customization data, Shopify safeguards certain files, such as config/settings_data.json, from being removed through the command line interface.

The error you are seeing is triggered when the shopify theme dev command attempts to synchronize your remote development theme with your local files. If your local project directory is missing these protected files, the CLI interprets this as a request to delete them from the remote theme. Shopify’s servers then step in and block this action, resulting in the error messages you have encountered.

To resolve this, you need to synchronize your local environment by pulling the necessary files from your Shopify store. You can do this by running the command shopify theme pull --store colorrave in your terminal.

This will download the theme files, including the ones that were missing from your local directory.

After the pull command has successfully completed and your local directory is fully populated with all the theme files, you can then run the shopify theme dev --store colorrave command again.

The issue should now be resolved, as the CLI will no longer attempt to delete the protected files from the remote theme.

Hope this helps!