Skip to content

Fix Vercel build: generate .env asset at build time from environment variable#1

Draft
harshwardhan-kp with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-flutter-installation-issue
Draft

Fix Vercel build: generate .env asset at build time from environment variable#1
harshwardhan-kp with Copilot wants to merge 3 commits into
mainfrom
copilot/fix-flutter-installation-issue

Conversation

Copilot AI commented Mar 1, 2026

Copy link
Copy Markdown

pubspec.yaml declares .env as a Flutter asset, but the file is gitignored, causing flutter build web to fail with No file or variants found for asset: .env.

Changes

  • vercel.json — Adds explicit Vercel build configuration:

    • buildCommand validates GROQ_APIKEY is set, writes it to .env, then runs flutter build web --release
    • outputDirectory set to build/web
    • installCommand matches the Flutter install logic previously configured only in Vercel's UI
    "buildCommand": "[ -n \"${GROQ_APIKEY}\" ] || { echo \"Error: GROQ_APIKEY environment variable is not set\"; exit 1; } && echo \"GROQ_APIKEY=${GROQ_APIKEY}\" > .env && flutter/bin/flutter build web --release"
  • .env.example — Documents required env vars for local development (cp .env.example .env)

  • .gitignore — Adds !.env.example exception so the template is tracked while real .env files stay ignored

Setup required: Add GROQ_APIKEY to Vercel project environment variables.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel

vercel Bot commented Mar 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
simple-chat-bot Ready Ready Preview, Comment Mar 1, 2026 0:32am
simple-chat-bot-n7v5 Ready Ready Preview, Comment Mar 1, 2026 0:32am

Copilot AI and others added 2 commits March 1, 2026 12:25
…ssing .env asset

Co-authored-by: harshwardhan-kp <181504774+harshwardhan-kp@users.noreply.github.com>
Co-authored-by: harshwardhan-kp <181504774+harshwardhan-kp@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix Flutter installation issue during build process Fix Vercel build: generate .env asset at build time from environment variable Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants