Shopify / Shopify/shopify-app-template-php

Issue to access the files of Deployed Shopify APP in Heroku

Open
#477 3 comments 0 reactions 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

Issue summary

I'm facing an issue using the Heroku environment.
I have created the app in Heroku and deployed Shopify APP using Docker Container, which everything it went successfully.
But when the APP is installed in the Testing Shopify Store, I have the issue of not being able to find dev_embed.js. and could not have access to index.jsx.

Here are the issues that are appearing at the browser, and also heroku log file:

  1. GET https://my-app.herokuapp.com/dev_embed.js net::ERR_ABORTED 404 (Not Found)
  2. Access to script at 'https://my-shopify-store.myshopify.com/admin/oauth/..../index.jsx') from origin 'https://my-app.herokuapp.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Steps that I followed to fix the issue:

  1. At web/nginx.conf, I have added:
 http {
     ...
         server {
         .... 
              # this part is added 
              location /dev_embed.js {
                    alias /app/web/frontend/dev_embed.js;
                }
         }
     }
  1. At Procfile I have this code:
  web: vendor/bin/heroku-php-apache2 public/
  worker: php artisan migrate

Do I need to add additional configuration of the files that need to be load from any Shopify Admin Panel to Heroku Server?
Because right now I'm still having the issue even though I did the above changes.

Looking forward to any feedback/help.

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 with web/nginx.conf and the Procfile, then inspect how the deployed Heroku container serves dev_embed.js and index.jsx. Review the browser errors and Heroku logs to trace the 404 and CORS failures; done means the installed Shopify app can load both files from the deployed app without those errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
apache, docker, javascript, nginx, php
Domain
cloud, devops, web-dev
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.