Skip to content
This repository was archived by the owner on Jan 19, 2026. It is now read-only.
This repository was archived by the owner on Jan 19, 2026. It is now read-only.

[v4] Unable to push certain components because 'component with this name already exists' #197

@angelikatyborska

Description

@angelikatyborska

Current behavior:

Steps to reproduce:

  1. Pull all components from my space 123:
    storyblok components pull --space 123 --separate-files --path ./src/schemas --suffix 123
    
  2. Try to push a component to the same space:
    components push --space=123 --from=123 --path ./src/schemas --suffix 123 --separate-files --verbose image
    
  3. I get this output:
      Storyblok CLI  
    
    
      Components   Pushing component image...
    
    
    ✔ Tag-> Whitelist: Root Body - Completed in 583.02ms
    ✔ Group-> Root Body - Completed in 337.41ms
    ✖ Component-> image - Failed
     Error 
    
    ▲ error Failed to update component image 
    ▲ error name: has already been taken 
    ▲ error API Error: The request was well-formed but was unable to be followed due to semantic errors {
      name: 'API Error',
      message: 'A component with this name already exists',
      httpCode: 422,
      cause: 'The request was well-formed but was unable to be followed due to semantic errors',
      errorId: 'unprocessable_entity',
      stack: 'API Error: A component with this name already exists\n' +
        '    at handleAPIError (file:///Users/angelikacathor/Documents/code/storyblok-website/node_modules/storyblok-next/dist/index.mjs:170:15)\n' +
        '    at updateComponent (file:///Users/angelikacathor/Documents/code/storyblok-website/node_modules/storyblok-next/dist/index.mjs:1006:5)\n' +
        '    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n' +
        '    at async upsertComponent (file:///Users/angelikacathor/Documents/code/storyblok-website/node_modules/storyblok-next/dist/index.mjs:1018:18)\n' +
        '    at async handleComponents (file:///Users/angelikacathor/Documents/code/storyblok-website/node_modules/storyblok-next/dist/index.mjs:1919:32)\n' +
        '    at async Command.<anonymous> (file:///Users/angelikacathor/Documents/code/storyblok-website/node_modules/storyblok-next/dist/index.mjs:2050:31)',
      responseData: { name: [ 'has already been taken' ] }
    }
    

**Expected behavior:**

Pushing a component to the same space from which I just downloaded should be "smart" and not create new components if the component already exists, but update it instead.

**Other information:**

I have discovered this problem while trying to push all components. Most of my 200 components could be pushed, but a few of them failed. It's always the same components that fail. I will try to find any pattern between them and let you know if I find anything. Posting all of their schemas here would be too much I think. But also let me know what I should look out for: how does the CLI determine whether to create a new component or update an existing one? There's probably a bug in that logic somewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    p4-important[Priority] Violate documented behavior or significantly improve performance (priority)v4

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions