Shopify / cli

Build apps, themes, and hydrogen storefronts for Shopify
https://shopify.dev
MIT License
401 stars 120 forks source link

[Bug]: ValidSchema isn't working #4187

Open njsaunders opened 1 month ago

njsaunders commented 1 month ago

Please confirm that you have:

In which of these areas are you experiencing a problem?

Theme

Expected behavior

Ran theme check on a theme with an invalid config/settings_schema.json (Duplicate declaration of entity).

.theme-check has ValidSchema check turned on:

ValidSchema:
  enabled: true
  ignore: []

shopify theme check should have failed.

Instead it passed, we pushed it to a github linked theme in shopify, where it silently failed.

Surely theme check should be detecting errors that would cause a theme to fail to be imported into Shopify?!

image (1)

Actual behavior

Theme check passed.

Verbose output

% shopify theme check --verbose
2024-07-11T10:11:16.266Z: Running command theme check
2024-07-11T10:11:20.774Z: Sync-reading the content of file at sections/main-collection.liquid...
2024-07-11T10:11:20.774Z: Sync-reading the content of file at sections/main-collection.liquid...
╭─ info ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                              │
│  sections/main-collection.liquid                                                                                                                             │
│                                                                                                                                                              │
│                                                                                                                                                              │
│  [warning]: DeprecatedFilter                                                                                                                                 │
│  Deprecated filter 'img_url', consider using 'image_url'.                                                                                                    │
│                                                                                                                                                              │
│  348  "image": "{{ product.featured_image | img_url: 'master' }}"                                                                                            │
│                                                                                                                                                              │
│                                                                                                                                                              │
│  [warning]: UndefinedObject                                                                                                                                  │
│  Unknown object 'link' used.                                                                                                                                 │
│                                                                                                                                                              │
│  342  unless link.type == 'http_link'                                                                                                                        │
│                                                                                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

2024-07-11T10:11:20.797Z: Sync-reading the content of file at snippets/image--responsive.liquid...
╭─ info ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                              │
│  snippets/image--responsive.liquid                                                                                                                           │
│                                                                                                                                                              │
│                                                                                                                                                              │
│  [warning]: DeprecatedFilter                                                                                                                                 │
│  Deprecated filter 'img_url', consider using 'image_url'.                                                                                                    │
│                                                                                                                                                              │
│  47  assign img_url = image | img_url: 'master'                                                                                                              │
│                                                                                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

2024-07-11T10:11:20.805Z: Sync-reading the content of file at templates/queue.liquid...
╭─ info ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                              │
│  templates/queue.liquid                                                                                                                                      │
│                                                                                                                                                              │
│                                                                                                                                                              │
│  [error]: LiquidHTMLSyntaxError                                                                                                                              │
│  Attempting to close HtmlElement 'body' before HtmlElement 'div' was closed                                                                                  │
│                                                                                                                                                              │
│  430    <div class="Throttle-Wrapper">                                                                                                                       │
│  431      <div class="Throttle-Inner">                                                                                                                       │
│  432       <img id="skkn_logo" width='786' height='370' loading='eager'                                                                                      │
│  src="https://cdn.shopify.com/s/files/1/0612/9893/3944/files/skkn_logo.png?v=1655418328" />                                                                  │
│  433       <div class="BlockStack-BlockStack BlockStack-spacingXloose">                                                                                      │
│  434          <div class="BlockStack-BlockStack BlockStack-alignmentCenter BlockStack-spacingLoose">                                                         │
│  435            <div class="ProgressBar-ProgressBar" style="--ProgressBar-width:91px;">                                                                      │
│  436            <div class="ProgressBar-ProgressBar-line"></div>                                                                                             │
│  437            <div class="ProgressBar-ProgressBar-line"></div>                                                                                             │
│  438            <div class="ProgressBar-ProgressBar-line"></div>                                                                                             │
│  439            <div class="ProgressBar-ProgressBar-line"></div>                                                                                             │
│  440            <div class="ProgressBar-ProgressBar-line"></div>                                                                                             │
│  441            <div class="ProgressBar-ProgressBar-line"></div>                                                                                             │
│  442            <div class="ProgressBar-ProgressBar-line"></div>                                                                                             │
│  443          </div>                                                                                                                                         │
│  444          <div class="TextContainer-TextContainer TextContainer-alignmentCenter TextContainer-spacingTight">                                             │
│  445            <h1 class="Heading-Heading Heading-h1">                                                                                                      │
│  446              You’re in line to check out                                                                                                                │
│  447            </h1>                                                                                                                                        │
│  448            <p id='estimatedWaitTime' class="TextBlock-TextBlock TextBlock-sizeMedium">                                                                  │
│  449              Calculating estimated wait time                                                                                                            │
│  450            </p>                                                                                                                                         │
│  451          </div>                                                                                                                                         │
│  452        </div>                                                                                                                                           │
│  453        <div class="BlockStack-BlockStack">                                                                                                              │
│  454          <div class="CartSummary-Wrapper">                                                                                                              │
│  455            <header class="CartSummary-Header">                                                                                                          │
│  456              <div class="InlineStack-InlineStack InlineStack-spacingTight_23fMX InlineStack-alignmentBaseline_Onw9y">                                   │
│  457                <h1 class="Heading-Heading Heading-h2">Your cart</h1>                                                                                    │
│  458                <p id="lastChecked" class="TextBlock-TextBlock TextBlock-sizeSmall TextBlock-subdued"></p>                                               │
│  459              </div>                                                                                                                                     │
│  460            </header>                                                                                                                                    │
│  461            <div class="CartSummary-Content">                                                                                                            │
│  462              <div role="table" aria-labelledby="ResourceList0" class="ResourceList-ResourceList">                                                       │
│  463                <div role="row" class="ResourceList-ResourceListHeader ResourceList-ResourceListHeader-isHidden">                                        │
│  464                  <div role="columnheader">                                                                                                              │
│  465                    <span class="VisuallyHidden-VisuallyHidden">Product image</span>                                                                     │
│  466                  </div>                                                                                                                                 │
│  467                  <div role="columnheader">                                                                                                              │
│  468                    <span class="VisuallyHidden-VisuallyHidden">Description</span>                                                                       │
│  469                  </div>                                                                                                                                 │
│  470                </div>                                                                                                                                   │
│  471                {% assign product_variants = product_variants %}                                                                                         │
│  472                {% assign product_image_by_variant_id = product_image_by_variant_id %}                                                                   │
│  473                {% for variant in product_variants %}                                                                                                    │
│  474                <div role="row" class="ResourceItem-ResourceItem">                                                                                       │
│  475                  <div role="cell" class="ResourceItem-ResourceItemContent">                                                                             │
│  476                    <div class="Thumbnail-Thumbnail Thumbnail-borderFull">                                                                               │
│  477                      {% if variant.image %}                                                                                                             │
│  478                      <img class="Thumbnail-Image" loading='eager' width='240' height='240' src="{{ variant.image | image_url: width: 240, height: 240   │
│  }}" alt="some media source">                                                                                                                                │
│  479                      {% else %}                                                                                                                         │
│  480                      <img class="Thumbnail-Image" loading='eager' width='240' height='240' src="{{ product_image_by_variant_id[variant.id] |            │
│  image_url: width: 240, height: 240 }}" alt="some media source">                                                                                             │
│  481                      {% endif %}                                                                                                                        │
│  482                    </div>                                                                                                                               │
│  483                  </div>                                                                                                                                 │
│  484                  {% assign product_title_by_variant_id = product_title_by_variant_id %}                                                                 │
│  485                  <div role="cell" class="ResourceItem-ResourceItemContent ResourceItem-ResourceItemContent-isPrimary">                                  │
│  486                    <p class="TextBlock-TextBlock TextBlock-emphasized">                                                                                 │
│  487                      <strong>{{ product_title_by_variant_id[variant.id] }}</strong>                                                                     │
│  488                    </p>                                                                                                                                 │
│  489                    {% assign default_variant_title = default_variant_title %}                                                                           │
│  490                    {% if variant.title != default_variant_title %}                                                                                      │
│  491                      <p class="TextBlock-TextBlock TextBlock-subdued">{{ variant.title }}</p>                                                           │
│  492                    {% endif %}                                                                                                                          │
│  493                    <p class="TextBlock-TextBlock">                                                                                                      │
│  494                      <div id="available-{{ variant.id }}" class="InlineStack-InlineStack InlineStack-spacingXtight InlineStack-alignmentCenter{% if     │
│  variant.available == false %} VisuallyHidden-VisuallyHidden{% endif %}">                                                                                    │
│  495                        <span class="Icon-Icon Icon-appearanceSuccess Icon-sizeSmall">                                                                   │
│  496                          <svg viewBox="0 0 20 20" class="Icon-Svg" focusable="false" aria-hidden="true">                                                │
│  497                            <path d="M20 5.347L7.647 17.462 0 9.962l2.393-2.347 5.254 5.154L17.607 3z"></path>                                           │
│  498                          </svg>                                                                                                                         │
│  499                        </span>                                                                                                                          │
│  500                        <strong class="Text-Text Text-emphasized Text-sizeSmall Text-appearanceSuccess">                                                 │
│  501                          <span class="Status-Text">Available</span>                                                                                     │
│  502                        </strong>                                                                                                                        │
│  503                      </div>                                                                                                                             │
│  504                      <div id="unavailable-{{ variant.id }}" class="InlineStack-InlineStack InlineStack-spacingXtight InlineStack-alignmentCenter{% if   │
│  variant.available == true %} VisuallyHidden-VisuallyHidden{% endif %}">                                                                                     │
│  505                        <span class="Icon-Icon Icon-appearanceCritical Icon-sizeSmall">                                                                  │
│  506                          <svg viewBox="0 0 24 24" class="Icon-Svg" focusable="false" aria-hidden="true">                                                │
│  507                            <path d="M12 24C5.373 24 0 18.627 0 12S5.373 0 12 0s12 5.373 12 12-5.373 12-12 12zm0-2c5.523 0 10-4.477 10-10S17.523 2 12 2  │
│   2 6.477 2 12s4.477 10 10 10zm0-16c.552 0 1 .448 1 1v5c0 .552-.448 1-1 1s-1-.448-1-1V7c0-.552.448-1 1-1zm-1.5 10.5c0-.828.666-1.5 1.5-1.5.828 0 1.5.666     │
│  1.5 1.5 0 .828-.666 1.5-1.5 1.5-.828 0-1.5-.666-1.5-1.5z"/>                                                                                                 │
│  508                          </svg>                                                                                                                         │
│  509                        </span>                                                                                                                          │
│  510                        <strong class="Text-Text Text-emphasized Text-sizeSmall Text-appearanceCritical">                                                │
│  511                          <span class="Status-Text">Sold out</span>                                                                                      │
│  512                        </strong>                                                                                                                        │
│  513                      </div>                                                                                                                             │
│  514                    </p>                                                                                                                                 │
│  515                  </div>                                                                                                                                 │
│  516                </div>                                                                                                                                   │
│  517                {% endfor %}                                                                                                                             │
│  518              </div>                                                                                                                                     │
│  519            </div>                                                                                                                                       │
│  520          </div>                                                                                                                                         │
│  521        </div>                                                                                                                                           │
│  522        <footer>                                                                                                                                         │
│  523          <div class="TextContainer-TextContainer TextContainer-alignmentCenter TextContainer-spacingTight">                                             │
│  524            <p class="TextBlock-TextBlock TextBlock-emphasized">                                                                                         │
│  525              <strong>Don’t refresh the page or you’ll lose your spot.</strong>                                                                          │
│  526            </p>                                                                                                                                         │
│  527            <p class="TextBlock-TextBlock TextBlock-subdued">Due to high traffic, you’ll need to wait a few minutes. When it’s your turn, checkout will  │
│   load automatically.</p>                                                                                                                                    │
│  528          </div>                                                                                                                                         │
│  529        </footer>                                                                                                                                        │
│  530      </div>                                                                                                                                             │
│  531    </div>                                                                                                                                               │
│  532  </body>                                                                                                                                                │
│                                                                                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

╭─ info ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                              │
│  Theme Check Summary.                                                                                                                                        │
│                                                                                                                                                              │
│  210 files inspected with 4 total offenses found across 3 files.                                                                                             │
│  1 errors.                                                                                                                                                   │
│  3 warnings.                                                                                                                                                 │
│                                                                                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯


### Reproduction steps

1. Install Shopify CLI
2. Download config/settings_schema.json from Shopify support ticket ID 49020903
3. Run Shopify theme check on it.

### Operating System

Mac OS

### Shopify CLI version (check your project's `package.json` if you're not sure)

3.63.1

### Shell

bash

### Node version (run `node -v` if you're not sure)

v22.3.0

### What language and version are you using in your application?

_No response_
jamesmengo commented 1 month ago

Hey @njsaunders 👋🏻 Thanks for the report! I was able to confirm that this is indeed buggy behaviour

I'm going to create an internal ticket to bring this to the team. Please let me know if there are any urgent fixes needed in the meantime - otherwise, you'll see an update on this ticket once the issue has been addressed!

github-actions[bot] commented 5 days ago

This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.

P.S. You can learn more about why we stale issues here.