Slow load times on deployed Shopify-app-node clone app

Topic summary

Main issue: extremely slow initial load (11–21 seconds) for the Shopify CLI-generated Node/React app when deployed (tested on Heroku, Google App Engine, and Google Cloud Run). Subsequent loads are much faster (hundreds of ms to ~2 seconds).

  • Investigation: Cold boot times (time needed for a server to spin up a new instance) contribute, but a comparable Next/Koa app without shopify-api (v1.2.1) and koa-shopify-auth (v4.1.2) shows much faster cold starts (1–3 seconds), suggesting these modules may add overhead.
  • Questions: What deployment environments were used to test the official sample and what initial load times are typical? What in koa-shopify-auth or shopify-api causes the slowdown? How are other developers mitigating this?
  • Suggested fix: One reply recommends ensuring a production build (run next build) and starting with NODE_ENV=production, noting dev mode includes just-in-time (JIT) asset compilation.
  • OP response: Confirms production start is already used on App Engine via the CLI’s start script (cross-env NODE_ENV=production node ./server/index.js), and requests further suggestions.
  • Other inputs: Multiple developers report the same issue.

Status: Unresolved; key questions and root cause remain open. No decisions or actionable outcomes yet.

Summarized with AI on February 20. AI used: gpt-5.

It sounds like the development version is being deployed, which includes just-in-time compilation of assets, etc. You’ll need to build a production version

$ npm run build        # which runs `next build`

then run/deploy the application using

$ npm run start        # which runs `NODE_ENV=production node server.js`