Shopify theme app extensions fail to build/deploy

Trying to build a new theme app extension (app block).

We’ve scaffolded the app project as explained in the docs (dir struct, dependencies, etc).

The app project currently only includes an extensions directory (no web dir) that includes a single liquid app block:


    App blocks let you build powerful integrations with online store themes!
  
{% schema %}
{
  "name": "Hello World",
  "target": "section",
  "stylesheet": "app.css",
  "javascript": "app.js",
  "settings": [
    {
      "label": "Color",
      "id": "color",
      "type": "color",
      "default": "#000000"
    }
  ]
}
{% endschema %}

We’ve successfully connected to our app in the partners dashboard.

But when we attempt to build or deploy the app extension code we get the following error:

npm run build
npm run deploy
> shopify app build

✔ Dependencies installed
theme_extensions | Building theme extensions...
theme_extensions | Installing theme dependencies...
theme_extensions | Installed theme dependencies!
theme_extensions | bundler: failed to load command: theme-check (/Users/***/Library/Caches/shopify-cli-nodejs/vendor/theme-check/1.10.3/ruby/2.6.0/bin/theme-check)
theme_extensions | /Users/***/Library/Caches/shopify-cli-nodejs/vendor/theme-check/1.10.3/ruby/2.6.0/gems/nokogiri-1.13.6-arm64-darwin/lib/nokogiri/extension.rb:30:in `require': cannot load such file -- nokogiri/nokogiri (LoadError)

Running simple theme-check command from does work - at least it runs the theme check tool.

Using the following versions:

  • shopify-cli (global that includes theme-check) 2.20.0
  • theme-check (installed with shopify-cli) 1.10.3
  • The app project is using “@shopify/cli”: “3.1.0”
1 Like

Update:

Some additional error logging. For some reason there seems to be a SW arch mismatch in the shopify tooling:

 /Users/***/Library/Caches/shopify-cli-nodejs/vendor/theme-check/1.10.3/ruby/2.6.0/gems
/nokogiri-1.13.6-arm64-darwin/lib/nokogiri/extension.rb:7:
in `require_relative': dlopen(/Users/***/Library/Caches/shopify-cli-nodejs/vendor/
theme-check/1.10.3/ruby/2.6.0/gems/nokogiri-1.13.6-arm64-darwin/lib/nokogiri/2.6/
nokogiri.bundle, 0x0009): 
tried: '/Users/***/Library/Caches/shopify-cli-nodejs/vendor/theme-check/1.10.3/ruby/2.6.0
/gems/nokogiri-1.13.6-arm64-darwin/lib/nokogiri/2.6/nokogiri.bundle' 
**(mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64h'))** 
- /Users/***/Library/Caches/shopify-cli-nodejs/vendor/theme-check/1.10.3/ruby/2.6.0
/gems/nokogiri-1.13.6-arm64-darwin/lib/nokogiri/2.6/nokogiri.bundle (LoadError)

We are running the tooling on OSX Monterey on an Intel i7 machine.

Hi @Shaibt ,

I had the same problem with my machine too.

It is the ruby version on your local env. I wrote my solution here https://github.com/Shopify/cli/issues/150#issuecomment-1185650167

Cheers,

Mirko

2 Likes