Shopify / Shopify/shopify-app-template-php

npm run build --api-key=REPLACE_ME not passing api_key into build

Open
#370 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

Running the yarn build command works, the npm run build command does not inject the api key as expected

Using yarn:
yarn build --api-key=REPLACE_ME

Using npm:
npm run build --api-key=REPLACE_ME

Expected behavior

What do you think should happen?
The npm run build command should inject the api key into the build

Actual behavior

What actually happens?
The build script reports

frontend         | Building the frontend app without an API key. The frontend build will not run without an API key. Set the SHOPIFY_API_KEY environment variable when running the build command.

Tip: include an error message (in a <details></details> tag) if your issue is related to an error

Steps to reproduce the problem

  1. npm run build --api-key=REPLACE_ME
  2. Where REPLACE_ME is the API Key

Reduced test case

The best way to get your bug fixed is to provide a reduced test case.


Checklist

  • I have described this issue in a way that is actionable (if possible)

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

Reproduce the discrepancy with yarn build --api-key=REPLACE_ME and npm run build --api-key=REPLACE_ME, then inspect the build configuration used by each command. Done means the npm command passes the API key into the frontend build and no longer reports that the key is missing.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, php
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.