<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Shopify development &#8211; In The Digital</title>
	<atom:link href="https://inthedigital.co.uk/category/shopify-development/feed/" rel="self" type="application/rss+xml" />
	<link>https://inthedigital.co.uk</link>
	<description>Web Design, Development and Digital Marketing</description>
	<lastBuildDate>Sat, 09 Nov 2024 15:35:12 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2018/10/cropped-in-the-digital-icon-padded.png?fit=32%2C32&#038;ssl=1</url>
	<title>Shopify development &#8211; In The Digital</title>
	<link>https://inthedigital.co.uk</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">153467252</site>	<item>
		<title>Shopify: The Theme you&#8217;re looking for couldn&#8217;t be found</title>
		<link>https://inthedigital.co.uk/shopify-the-theme-youre-looking-for-couldnt-be-found/</link>
					<comments>https://inthedigital.co.uk/shopify-the-theme-youre-looking-for-couldnt-be-found/#respond</comments>
		
		<dc:creator><![CDATA[Mervyn Booth]]></dc:creator>
		<pubDate>Sat, 09 Nov 2024 15:31:05 +0000</pubDate>
				<category><![CDATA[Shopify development]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Shopify theme dev]]></category>
		<guid isPermaLink="false">https://inthedigital.co.uk/?p=2720</guid>

					<description><![CDATA[<img width="300" height="300" src="https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/the-theme-youre-looking-for-couldnt-be-found-.webp?fit=300%2C300&amp;ssl=1" class="attachment-medium size-medium wp-post-image" alt="Screenshot of the Shopify theme not loading message - The Theme you&#039;re looking for couldn&#039;t be found Check the web address and try again, or try navigating to the Theme Editor from Theme." style="float: none; margin: auto;" decoding="async" fetchpriority="high" />How to fix "The Theme you're looking for couldn't be found. Check the web address and try again, or try navigating to the Theme Editor from Theme"]]></description>
										<content:encoded><![CDATA[<img width="300" height="300" src="https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/the-theme-youre-looking-for-couldnt-be-found-.webp?fit=300%2C300&amp;ssl=1" class="attachment-medium size-medium wp-post-image" alt="Screenshot of the Shopify theme not loading message - The Theme you&#039;re looking for couldn&#039;t be found Check the web address and try again, or try navigating to the Theme Editor from Theme." style="float: none; margin: auto;" decoding="async" loading="lazy" /><p><img decoding="async" class="alignnone size-full wp-image-2723" style="max-width: 100%;" src="https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/the-theme-youre-looking-for-couldnt-be-found-ls.webp?resize=1200%2C296&#038;ssl=1" alt="Screenshot of the Shopify theme not loading message - The Theme you're looking for couldn't be found Check the web address and try again, or try navigating to the Theme Editor from Theme." width="1200" height="296" srcset="https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/the-theme-youre-looking-for-couldnt-be-found-ls.webp?w=1200&amp;ssl=1 1200w, https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/the-theme-youre-looking-for-couldnt-be-found-ls.webp?resize=300%2C74&amp;ssl=1 300w, https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/the-theme-youre-looking-for-couldnt-be-found-ls.webp?resize=1024%2C253&amp;ssl=1 1024w, https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/the-theme-youre-looking-for-couldnt-be-found-ls.webp?resize=768%2C189&amp;ssl=1 768w" sizes="(max-width: 1000px) 100vw, 1000px" data-recalc-dims="1" /></p>
<h2>The Theme you&#8217;re looking for couldn&#8217;t be found. <span class="d-block h4 text-muted">Check the web address and try again, or try navigating to the Theme Editor from Theme</span></h2>
<p>If you&#8217;ve ever been working on a Shopify theme and this seemingly major error occurs, do not fear &#8211; there&#8217;s a simple fix!</p>
<h3>Why Does &#8220;The Theme you&#8217;re looking for couldn&#8217;t be found.&#8221; happen?</h3>
<p>I&#8217;ve searched the web for an answer to this. Even though I didn&#8217;t find one, I did get <em>enough</em> insight into the <em>why</em> to understand what happens under the bonnet.</p>
<p>On the surface, what appears to be happening is that something in the theme&#8217;s code has changed. And that&#8217;s is absolutely the case. But the problem isn&#8217;t that the code has changed, it is that the content&#8217;s no longer aligned with the theme&#8217;s schema!</p>
<h3>What&#8217;s the theme&#8217;s schema?!</h3>
<p>In Shopify themes are made up of templates. Most of the templates are for rendering the content &#8211; these are Liquid templates (a templating language for building HMTL pages). When these Liquid templates have content in them that&#8217;s populated/configured in the visual editor there&#8217;s a schema section (typically at the bottom) where the information for the visual editor exists. It is this section that&#8217;s at the core of the bug!</p>
<h3>Why is the theme&#8217;s schema causing the problem?</h3>
<p>The problem arises when this schema&#8217;s data is not in sync with the theme&#8217;s configuration &#8211; I&#8217;ll come back to this in a bit. As I said earlier, I was not able to find any support from the web about this as the advice fails to provide any actual solutions, even Shopify&#8217;s support forums failed to solve the problem &#8211; all I found was, &#8220;Try clearing the cache&#8221;, &#8220;Use a private browser window&#8221; and so on. None of this worked, and it&#8217;s very obvious it wouldn&#8217;t because the problem is server-side.</p>
<h4>The theme&#8217;s config files</h4>
<p>Before we proceed to the solution, let&#8217;s first familiarise ourselves with the theme&#8217;s config files. There are two of them;</p>
<ul>
<li><a href="https://shopify.dev/docs/storefronts/themes/architecture/config/settings-data-json" target="_blank" rel="noopener nofollow">settings_data.json</a> and,</li>
<li><a href="https://shopify.dev/docs/storefronts/themes/architecture/config/settings-schema-json" target="_blank" rel="noopener nofollow">setting_scheam.json</a>.</li>
</ul>
<p>The one we&#8217;re concerned with is the first one. This is where settings &#8220;values&#8221; are stored from the actions taken in the visual editor. This is where we will find the offending data that&#8217;s broken the synchronisation between the schema data stored in the Liquid files and the data stored when the theme&#8217;s content is edited.</p>
<h2>How to recreate a scenario that we can use to introduce the problem</h2>
<p>Now the real root of the problem has been unearthed, let&#8217;s look at an example to demonstrate how the issue arose and how to fix it.</p>
<h3>Step 1: create a new feature in the header.liquid template</h3>
<p>Here&#8217;s an extract to add a repeater of an image and a link (it could be used to output a list of linked partner icons). Note that this is an example &#8211; feel free to reach out for help if you need to know how to build this into a theme and code the Liquid part to render it.</p>
<pre><code class="language-json">...
&quot;blocks&quot;: [
    {
      &quot;type&quot;: &quot;example_icon_list_item&quot;,
      &quot;name&quot;: &quot;Icon&quot;,
      &quot;settings&quot;: [
        {
          &quot;type&quot;: &quot;image_picker&quot;,
          &quot;id&quot;: &quot;example_icon_image&quot;,
          &quot;label&quot;: &quot;An Icon&quot;,
          &quot;info&quot;: &quot;An SVG is recommended&quot;
        },
        {
          &quot;type&quot;: &quot;url&quot;,
          &quot;id&quot;: &quot;example_icon_url&quot;,
          &quot;label&quot;: &quot;A link&quot;,
          &quot;info&quot;: &quot;e.g. a link to a partner&#039;s website&quot;
        }
      ]
    }
...</code></pre>
<h3>Step 2: add values to the new block</h3>
<p>With the above configuration added to the header.liquid template, we can now head over to the theme&#8217;s visual editor, where we can add some values to this new feature.</p>
<p><img decoding="async" class="alignnone size-full wp-image-2734" style="max-width: 100%;" src="https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/shopify-theme-editor-header.webp?resize=1252%2C804&#038;ssl=1" alt="A screenshot of the Shopofy theme editor showing a custom block for adding images and links to the header section of the website." width="1252" height="804" srcset="https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/shopify-theme-editor-header.webp?w=1252&amp;ssl=1 1252w, https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/shopify-theme-editor-header.webp?resize=300%2C193&amp;ssl=1 300w, https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/shopify-theme-editor-header.webp?resize=1024%2C658&amp;ssl=1 1024w, https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/shopify-theme-editor-header.webp?resize=768%2C493&amp;ssl=1 768w" sizes="(max-width: 1000px) 100vw, 1000px" data-recalc-dims="1" /></p>
<h3>Understanding how Shopify stores the data from the theme editor</h3>
<p>Now the new feature&#8217;s in use, let&#8217;s take a look at what Shopify has generated to store the image and link.</p>
<p>At this stage everything is good and the new feature works as expected (just needs to be rendered, which we don&#8217;t need to do to recreate the issue).</p>
<pre><code class="language-json">...
    &quot;sections&quot;: {
      &quot;header&quot;: {
        &quot;type&quot;: &quot;header&quot;,
        &quot;blocks&quot;: {
          &quot;example_icon_list_nYq7Fx&quot;: {
            &quot;type&quot;: &quot;example_icon_list_item&quot;,
            &quot;settings&quot;: {
              &quot;example_icon_image&quot;: &quot;shopify://shop_images/icon-shipping.svg&quot;,
              &quot;example_icon_image&quot;: &quot;shopify://pages/delivery-information&quot;
            }
          }
        },
        &quot;block_order&quot;: [
          &quot;example_icon_list_nYq7Fx&quot;
        ],
...</code></pre>
<p>As can be seen from the extract above, which is taken from the theme&#8217;s <code>settings_data.json</code> file, the image (<code>shopify://shop_images/icon-shipping.svg</code>) and link (<code>shopify://pages/delivery-information</code>) are now stored as values in the theme.</p>
<h2>How to demonstrate the problem</h2>
<p>It&#8217;s easy to recreate the issue, all we need to do is change the JSON data in the header.liquid template&#8217;s schema so that the values stored in the settings_data.json are not no longer valid (e.g. they don&#8217;t correspond to anything therefore Shopify doesn&#8217;t know what to do with them). For simplicity, I&#8217;ll just remove the blocks section from the header.liquid template.</p>
<pre><code class="language-json">{% schema %}
{
  &quot;name&quot;: {
    ...
    &quot;en&quot;: &quot;Header&quot;,
    ...
  },
  &quot;class&quot;: &quot;header-section&quot;,
  &quot;settings&quot;: [
    ...
  ],
  ...
}
{% endschema %}</code></pre>
<p>This will now introduce the issue and the dreaded &#8220;Grey screen of death&#8221; will appear instead of the theme&#8217;s visual editor:<br />
<img decoding="async" class="alignnone size-full wp-image-2723" style="max-width: 100%;" src="https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/the-theme-youre-looking-for-couldnt-be-found-ls.webp?resize=1200%2C296&#038;ssl=1" alt="Screenshot of the Shopify theme not loading message - The Theme you're looking for couldn't be found Check the web address and try again, or try navigating to the Theme Editor from Theme." width="1200" height="296" srcset="https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/the-theme-youre-looking-for-couldnt-be-found-ls.webp?w=1200&amp;ssl=1 1200w, https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/the-theme-youre-looking-for-couldnt-be-found-ls.webp?resize=300%2C74&amp;ssl=1 300w, https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/the-theme-youre-looking-for-couldnt-be-found-ls.webp?resize=1024%2C253&amp;ssl=1 1024w, https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/the-theme-youre-looking-for-couldnt-be-found-ls.webp?resize=768%2C189&amp;ssl=1 768w" sizes="(max-width: 1000px) 100vw, 1000px" data-recalc-dims="1" /></p>
<h2>How to fix the issue and load the visual theme editor once again</h2>
<p>Now we&#8217;ve reversed-engineered the problem, we can easily solve it. How? We resync them in one of two ways:</p>
<ol>
<li>We put the data back in the JSON schema section of the header.liquid file, or;</li>
<li>We remove the data that Shopify generated and stored in settings_data.json</li>
</ol>
<h3>Option 2: remove the data that Shopify generated and stored in settings_data.json</h3>
<p>This is easy, BUT BE CAREFUL! We identify the block of data and simply delete it. Job done and the theme&#8217;s editor will be back in play!</p>
<pre><code class="language-json">...
    &quot;sections&quot;: {
      &quot;header&quot;: {
        &quot;type&quot;: &quot;header&quot;,
...</code></pre>
<h2>Need help with this?</h2>
<p>I wrote this post to help others so that they don&#8217;t have to go through the pain that I had to, in order to resolve this issue. However, if you&#8217;re feeling lazy, feel free to reach out for our help. We build Shopify themes, so we have a pretty good understanding of how the platform works.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://inthedigital.co.uk/shopify-the-theme-youre-looking-for-couldnt-be-found/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2720</post-id>	</item>
	</channel>
</rss>
