Repository navigation
Netlify deploy error due to missing IMAGE_BASE_URL environment variable - #1
Open
netlify-coding[bot] wants to merge 1 commit into
Open
netlify-coding[bot] wants to merge 1 commit into
netlify-coding[bot] wants to merge 1 commit into
Conversation
…le (6a0bbc1062112567a3b2bd39)
✅ Deploy Preview for orion-base-configurator ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🔗 View agent run: https://app.netlify.com/projects/orion-base-configurator/agent-runs/6a0bbc1062112567a3b2bd39
🤖 Agent: Claude
💬 Prompt: The Netlify deploy errored, with the following guidance provided:
Diagnosis — relevant log lines
✅ Result: The Netlify deploy was failing because the build command in
netlify.tomlreferenced the environment variable$IMAGE_BASE_URLdirectly on the command line (python3 build.py --image-base $IMAGE_BASE_URL). When that variable is not set in the Netlify environment, the shell expands it to an empty string, leaving--image-basewith no argument. argparse then exits with code 2 and the message "expected one argument", aborting the build.Two changes were made to fix this cleanly.
netlify.toml— The build command was simplified topython3 build.pywith no shell variable reference. A comment explains thatIMAGE_BASE_URLcan still be set via Netlify's environment variable UI and thatbuild.pywill pick it up automatically.build.py— A fallback was added inmain(): after argparse runs, if--image-basewas not supplied on the command line, the script readsIMAGE_BASE_URLfrom the process environment. This preserves full flexibility — the env var is still honoured if set, and the explicit--image-baseCLI flag continues to work for local development — but the build no longer breaks when the variable is absent. When neither is set the template's existing default (./imagesrelative path) is used, which resolves correctly for a standard Netlify deployment.