Shopify / shopify-app-template-php

263 stars 85 forks source link

deployed on AWS show error Missing host query argument #462

Open NomanHameed opened 11 months ago

NomanHameed commented 11 months ago

ISSUE SUMMERY

Trying to deploy Shopify-App-Temp-PHP on AWS ec2 but getting error Missing host query argument

What I Try to Do Setup Apache2 on AWS EC2 instance and

git clone git-url-of-my-app

in root directory run

npm install cd web

update .env as per requirements then run

composer install php artisan migrate --seed cd .. npm run build

also change root path to

/var/www/html/app/web/public

then got error

Missing host query argument Your app can only load if the URL has a host argument. Please ensure that it is set, or access your app using the Partners Dashboard Test your app feature

please guide if anyone solve this issue before also share some document if i'm not deploy in right way on AWS. share some helping guide to deploy shopify-app-temp-php app on AWS.

Thanks.

Muhammad-Daniyal4 commented 10 months ago

Remove node modules and install it again by running npm i. Hopefully It will run.

waqas61 commented 10 months ago

@NomanHameed Salam !

I am trying to publish at cpanel but app is not redirecting to Exitframe for auth.

Shopify\Utils::sanitizeShopDomain(): Argument #1 ($shop) must be of type string, null given

Can you please tell me steps for making build on windows?

Thank You

NomanHameed commented 10 months ago

@waqas61 please try to load you app URL with a shop parameter example below

https://{app.url.com}/?shop={shopify-store-url}

and for build use command on local

npm run build --api-key=REPLACE_ME

if still any issue feel free to ask.

rafaelstz commented 10 months ago

Hi @waqas61, make sure your shop URL is correct (e.g. storename.myshopify.com). Then you can access:

https://{app.url.com}/api/auth?shop={shopify-store-url}

I made some changes in my code to make sure it shows an install page instead of an error when you access other URLs, or when you don't have the shop params.

waqas61 commented 10 months ago

@rafaelstz and @NomanHameed

I have deployed the app successfully. Actaully there was issue with env api key while app building on windows. I had to set enviroment variable for api key in powerhshell for build .

Really thankful for your time and support.No words for appreciate but

Thank you .

sonali-webmavens commented 8 months ago

Hi @waqas61, make sure your shop URL is correct (e.g. storename.myshopify.com). Then you can access:

https://{app.url.com}/api/auth?shop={shopify-store-url}

I made some changes in my code to make sure it shows an install page instead of an error when you access other URLs, or when you don't have the shop params.

Hi, @rafaelstz I am facing the same error. I tried as you suggested above. Below is my code.

Route::get('/', function (Request $request) {
    $session = $request->get('shopifySession');
     INFO($session);
       if (empty($session)) {
        $shop = $request->query('shop');
        return redirect('/api/auth?shop='.$shop);
    }
});

The above code is not working with the production URL. It is not redirecting.

I also notice. If I add a URL in-app setup like below.

https://{app.url.com}/api/auth

It shows an installation page. However, after that it reloads multiple times and gives the error App is not loading properly.

Any help would be appreciated.

waqas61 commented 8 months ago

@sonali-webmavens

Thank You

vaimeo commented 3 months ago

The issue exist on the development state also.