skip to Main Content

I’ve made few updates to a Shopify app running on Ruby/Rails, updates were simply new release updated made and logic + code adjusted. Everything works when it comes to deployment of the app with new version and modes but if we try to access any home_controller, or any other controller / view it comes up with error page we set and in logs shows the following;

I,[2024-03-13T17:56:17.131281 #2]  INFO -- : [ ShopifyApp | INFO | Shop Not Found ] Installed store  - test-rssfeed.myshopify.com deduced from user session 2024-03-13T17:56:17.131732+00:00 app[web.1]:
F, [2024-03-13T17:56:17.131699 #2] FATAL -- : [0d99f118-4eae-4061-8121-cec1bcab1c45] 2024-03-13T17:56:17.131734+00:00 app[web.1]: 
[0d99f118-4eae-4061-8121-cec1bcab1c45] TypeError (Passed `nil` into T.must): 2024-03-13T17:56:17.131735+00:00 app[web.1]: 
[0d99f118-4eae-4061-8121-cec1bcab1c45] 2024-03-13T17:56:17.131748+00:00 app[web.1]: 
[0d99f118-4eae-4061-8121-cec1bcab1c45] sorbet-runtime (0.5.11292) lib/types/_types.rb:222:in `must' 2024-03-13T17:56:17.131749+00:00 app[web.1]: 
[0d99f118-4eae-4061-8121-cec1bcab1c45] shopify_api (14.0.1) lib/shopify_api/context.rb:173:in `host_scheme' 2024-03-13T17:56:17.131750+00:00 app[web.1]: 
[0d99f118-4eae-4061-8121-cec1bcab1c45] sorbet-runtime (0.5.11292) lib/types/private/methods/call_validation_2_7.rb:59:in `bind_call'

I’d do more troubleshooting but I’m not sure where to even begin looking for Nil that is being passed into T.must

Tried different version of Ruby, tried removing Sorbet or updating it as well.

2

Answers


  1. I faced the same problem. After adding HOST variable in .env file. It is working fine for me. Host is app url.

    Login or Signup to reply.
  2. I upgraded shopify_app gem from 17.1.1 to 14.6.0 and got similar error.

    I fixed by adding host address at config/initializers/shopify_app.rb

    Here sample configuration:

    Rails.application.config.after_initialize do
      if ShopifyApp.configuration.api_key.present? && ShopifyApp.configuration.secret.present?
        ShopifyAPI::Context.setup(
          api_key: ShopifyApp.configuration.api_key,
          api_secret_key: ShopifyApp.configuration.secret,
          api_version: ShopifyApp.configuration.api_version,
    
          # Add host information here
          host: ENV.fetch('APP_URL'), # 'http://your-shopify.myshopify.com',
    
          scope: ShopifyApp.configuration.scope,
          is_private: !ENV.fetch('SHOPIFY_APP_PRIVATE_SHOP', '').empty?,
          is_embedded: ShopifyApp.configuration.embedded_app,
          log_level: :info,
          logger: Rails.logger,
          private_shop: ENV.fetch('SHOPIFY_APP_PRIVATE_SHOP', nil),
          user_agent_prefix: "ShopifyApp/#{ShopifyApp::VERSION}"
        )
    
        ShopifyApp::WebhooksManager.add_registrations
      end
    end
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search