Updating a Block in Staging

In this article, we’ll cover how to make updates to your block in a staging environment.

First, confirm that your block is in a staging environment by clicking "Edit” in your block and viewing the left side panel. The presence of a "Staged Block” message means that the block will not appear live on your storefront, but you can still preview it through the preview URL.  

  1. Go to your block code > configs and make the necessary change. 
  2. Once your watch task has run all of your tests again and everything passes, compile the block code again by running `npn run build`. Everything should pass since they are being run alongside your changes. 
  3. This time, instead of running `element publish` to put the brand new block out there, run `element update`. This will update the block for staging.
  4. Confirm the change by viewing your left side panel in Site Designer, refreshing the page, clicking the "Continue Editing” button, and clicking "Edit” within the block.
  5. Click the Preview button at the top to see a preview URL in the renderer.