Build command failing due to conflicting requirements for the Ruby version by theme check

Topic summary

A build command failure occurs due to conflicting Ruby version requirements with theme-check (requires Ruby ≥ 2.7), despite the dev command working correctly. The app is built on Shopify’s QR code template.

Environment tested:

  • Multiple Ruby versions via rbenv: system, 2.7.8, 3.1.0, 3.1.3
  • Node 18.16.0, npm 9.5.1, Shopify CLI 3.48.0
  • Error persists across all Ruby versions

Resolution steps:

  1. Upgrading Shopify CLI fixed the initial build error
  2. New issue emerged: “Invalid hook call” warning in yarn dev
  3. Root cause identified: Two conflicting React versions present (app had older React, newer Shopify CLI ships with React 18)
  4. Following the React 18 upgrade guide resolved all issues

Status: Resolved, though the original poster remains uncertain why the issue only affected their system when colleagues with identical dependencies had no problems.

Summarized with AI on November 12. AI used: claude-sonnet-4-5-20250929.

Hi,
I’ve been getting the following build error on my system; it’s working fine on my peers systems. It’s been a few days, and I have read so many discussions & answers but am still unable to resolve them. Any help would be deeply appreciated :folded_hands:

Error

dev command runs fine, but build is always failing with the following error. Our app is on top of shopify’s qrcode template.

npm run build

> ***@0.1.0 build
> shopify app build

customer-wallet │ Running theme check on your Theme app extension...
web-frontend    │
web-frontend    │ > build
web-frontend    │ > vite build
web-frontend    │
web-frontend    │ vite v2.9.17 building for production...
web-frontend    │ transforming...

── external error ──────────────────────────────────────────────────────────────

Error coming from `bundle install`

Command failed with exit code 6: bundle install
Bundler found conflicting requirements for the Ruby version:
  In Gemfile:
    Ruby

    theme-check (= 1.15.0) was resolved to 1.15.0, which depends on
      Ruby (>= 2.7)
Fetching gem metadata from https://rubygems.org/........
Resolving dependencies...

Environment

I’ve tried running the build command on various ruby versions using rbenv namely - system, 2.7.8, 3.1.0, 3.1.3 ; but same error everywhere.

  1. ruby -v
    ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [arm64-darwin22]
    
  2. rbenv local
    3.1.0
    
  3. gem list | grep bundler
    bundler (2.5.6, default: 2.3.3)
    
  4. openssl version
    OpenSSL 3.2.1 30 Jan 2024 (Library: OpenSSL 3.2.1 30 Jan 2024)
    
  5. Shopify CLI 3.48.0 ? Version 3.56.2 available! Run yarn shopify upgrade
    Package manager yarn
    OS darwin-arm64
    Shell /bin/zsh
    Node version v18.16.0
    System:
    OS: macOS 13.6.1
    CPU: (8) arm64 Apple M1
    Memory: 61.30 MB / 16.00 GB
    Shell:
    version: "5.9"
    path: /bin/zsh
    Binaries:
    Node:
    version: 18.16.0
    path: ~/.n/bin/node
    Yarn:
    version: 1.22.21
    path: ~/Documents/rzp/shopify-wallet/node_modules/.bin/yarn
    npm:
    version: 9.5.1
    path: ~/.n/bin/npm
    Watchman:
    version: 2022.07.04.00
    path: /usr/local/bin/watchman
    Managers:
    CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
    Xcode:
    version: 15.2/15C500b
    path: /usr/bin/xcodebuild
    Languages:
    Java:
    version: 11.0.22
    path: /usr/bin/javac
    Ruby:
    version: 3.1.0
    path: /Users/ayush.gupta/.rbenv/shims/ruby
    
    

Hi Ayush,

If you run yarn shopify upgrade does this fix anything?

1 Like

Hi Liam, I upgraded Shopify CLI & it has fixed the build command. but when I ran yarn dev, it failed with the below warning - “Warning: Invalid hook call. Hooks can only be called inside of the body of a function component”. According to the docs, I found out that there are two React versions in my app. The newer Shopify app & cli ships with React 18. Running npm ls react gave the following output:

I followed React 18 upgrade guide & it resolved all issues for me.

However, I’m still unsure what was causing issues in my system even though it was working on my colleagues’ system with the same dependencies. Anyways, it’s resolved for now.

Appreciate the quick response, I was blocked here for days. :raising_hands:

Very strange but I’m glad it’s back working for you

1 Like