Need help solving AppBridgeError INVALID_CONFIG: host must be provided

Need help solving AppBridgeError INVALID_CONFIG: host must be provided

reikje
Shopify Partner
6 0 2

Hello, I know this error has been discussed previously but none of the solutions work for me. I did a very quick sanity test. 

 

  • created a new dummy app (node) as described here: https://shopify.dev/apps/getting-started/create 
  • in my package.json I added: 

    "prod": "NEXT_TELEMETRY_DISABLED=1 next build && next start"

  • started local using: npm run prod
  • created a ngrok manually to test it: ngrok http 3000
  • updated "App URL" and "Allowed redirection URL(s)" for my app under partners.shopify.com
  • clicked Test your App > Select Store

 

While the approach using "shopify app serve" works, this production like approach where next build && start is used does not. I am hitting "host must be provided". I also noticed that in pages/_app.js in getInitialProps, there is no 'host' param in the query string when logging: console.log(JSON.stringify(ctx.query));

 

I haven't made any changes to the code generated by "shopify app create node" so this one should be easy to repo. I am using shopify-cli 2.7.2  

Reply 1 (1)

reikje
Shopify Partner
6 0 2

I think the problem is using "next start"? Do I need to add additional environment variables (i.e. host) to next.config.js in case I want to run using "next start"?