[Bug Fix] process.env.APP_URL doesn't work in production build #5258
+30
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
WHY are these changes introduced?
UI Extensions can request web API that you defined in web app.
In local development by using
shopify app dev
, web API host changes every time you launch dev server via cloudflare tunnel. It is very useful to useAPP_URL
environment variable to refer that tunnel url like this.UI Extension
In production, however,
APP_URL
cannot be web API url (application_url inshopify.app.toml
) throughshopify app deploy
orshopify app build
. We expect that environment variables will change its value the environment basis (local, production) but it don't work now.WHAT is this pull request doing?
shopify app dev
passes configuration.application_url asAPP_URL
to extension build process.cli/packages/app/src/cli/services/dev/app-events/app-event-watcher.ts
Line 270 in 7b3ba77
otherwise, it isn't passed to extension build process in
shopify app build
andshopify app deploy
command.cli/packages/app/src/cli/services/deploy/bundle.ts
Line 38 in 7b3ba77
In this PR, I added extra argument as
AppURL
.How to test your changes?
Post-release steps
Measuring impact
How do we know this change was effective? Please choose one:
Checklist