Shopify / Shopify/shopify-app-template-php

Hostname env.HOST not_defined

Open
#467 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
340
Forks
108
PR merge metrics
No merged PRs in 30d

Description

The HOST environmental variable is null when running npm run dev on some systems.

I can't for the life of me figure out why it happens, but it only happens on some systems, and when it happens, it always happens consistently on those systems.

https://github.com/Shopify/shopify-app-template-php/blob/f3d8e9fe0dee30d941eea330dfb06e2f818c01b5/web/app/Providers/AppServiceProvider.php#L37

As a result, the laravel app doesn't really work at all and the app inside shopify doesn't show anything.

I've followed the instructions to the letter in 3 macOs and 5 or 6 linux installations, with the latest node and php versions. It only worked in 1 mac and 1 linux instance.
The same exact project files also only work on these installations.

The iframe src inside shopify points to the new tunnel address, however the page itself is errored and invisible.

I'm really new to both Laravel and node/vite, so I can't really figure out where or why things are going wrong.

Works in:
Mac VM (UTM)
Debian (Parallels)

Doesn't work in:
Mac (baremetal)
Mac VM (Parallels)
Debian (UTM)
Fedora (Parallels)

All VMs were vanilla installations and had shared networking with the base M1 Pro machine.

Any help or ideas on how I could go abount hunting this issue down, would be greatly appreciated.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at web/app/Providers/AppServiceProvider.php line 37 and reproduce the HOST behavior with npm run dev on the listed macOS and Linux setups. Compare the environments where HOST is null with those where it works, then verify that the tunnel address and embedded Shopify page render successfully once the issue is resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
laravel, node.js, php
Domain
backend, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.