Issue Hosting Remix Shopify App – Need Proper Hosting Steps

Topic summary

Hosting a Remix-based Shopify app on Heroku failed in production with a DNS error (getaddrinfo ENOTFOUND) when resolving the app’s Heroku URL. Local development (npm run dev) worked.

Setup context:

  • Hosting on Heroku with env vars: SHOPIFY_API_KEY, SHOPIFY_API_SECRET_KEY, SCOPES, HOST, SHOPIFY_APP_URL (set to the Heroku app URL).
  • Procfile: web: npm run start.
  • Error appeared at runtime; also saw a non-blocking Node experimental JSON import warning.

Key questions raised:

  • Whether Procfile command (npm run start) is correct for Remix Shopify apps.
  • Whether SHOPIFY_APP_URL should be the Heroku URL.
  • Best practices for deploying Remix Shopify apps to Heroku/other platforms.

Resolution:

  • Issue was fixed by removing the HOST environment variable from the .env file. After removing HOST, the app worked in production.

Status: Resolved; no further changes or best-practice steps were discussed.

Summarized with AI on December 17. AI used: gpt-5.

Hello everyone,

I am currently working on hosting a Shopify app built using Remix, and I am facing issues with the hosting setup.

Setup Details:- I am using Heroku to host my app, and my app URL is: https://testdyno-99f8eee3322a.herokuapp.com/

  • In my environment variables, I have set the following:
    • SHOPIFY_API_KEY
    • SHOPIFY_API_SECRET_KEY
    • SCOPES
    • HOST (the same as my Heroku app URL)
    • SHOPIFY_APP_URL (again, matching the Heroku app URL)

The issue:

When I try to run the app in production, I get the following error:
(node:17548) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
[shopify-api/INFO] version 11.4.0, environment Remix
[shopify-app/INFO] Future flag wip_optionalScopesApi is disabled.
Enable this to use the optionalScopes API to request additional scopes and manage them.
Error: getaddrinfo ENOTFOUND https://testdyno-99f8eee3322a.herokuapp.com/
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26)

**Questions:**1. Procfile Setup: In the Heroku Procfile, I currently have web: npm run start. Is this the correct command for a Remix Shopify app? Or is there a different command I should be using for hosting this app?

  1. SHOPIFY_APP_URL: For the SHOPIFY_APP_URL, should I be entering the same Heroku URL where my app is hosted (https://testdyno-99f8eee3322a.herokuapp.com/), or is there a different URL I should be using?

  2. Remix Hosting: Can anyone provide the correct steps or best practices for hosting a Remix Shopify app on Heroku (or any other platform)? I’ve been running into issues where npm run dev works perfectly in local development, but I can’t figure out the right setup for production.

Any guidance would be greatly appreciated! Thank you.

Hey, I solved this issue by simply removing the HOST variable in the .env file. Everything is working fine now!