Skip to content

Conversation

@WillemJiang
Copy link
Collaborator

Fixes #355 This pull request updates the development and production startup processes and simplifies the environment variable handling for the web application. The main focus is to ensure dependencies are always installed before starting the frontend and to streamline how the development server is launched.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request addresses issue #355 by removing the dependency on the dotenv-cli package which was causing "command not found" errors. The fix simplifies the development script by relying on Next.js's native environment variable loading and adds dependency installation steps to the bootstrap script.

Changes:

  • Removed dotenv -f ../.env -- from the web dev script, switching to Next.js native .env loading
  • Added pnpm install commands to bootstrap.sh for both development and production modes

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
web/package.json Simplified dev script by removing dotenv-cli wrapper, now uses plain Next.js dev command
bootstrap.sh Added pnpm install before starting frontend in both dev and production modes

"build": "next build",
"check": "next lint && tsc --noEmit",
"dev": "dotenv -f ../.env -- next dev --turbo",
"dev": "next dev --turbo",
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of dotenv -f ../.env changes how environment variables are loaded. Previously, the dev script loaded environment variables from the parent directory's .env file. Now, Next.js will only load from .env files in the web/ directory. This could be a breaking change if users have their NEXT_PUBLIC_API_URL and other frontend environment variables in the root .env file instead of web/.env. Consider documenting this change in the PR description or adding migration instructions to help users transition their environment variable setup.

Suggested change
"dev": "next dev --turbo",
"dev": "dotenv -f ../.env -- next dev --turbo",

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +15
cd web && pnpm install && pnpm dev & WEB_PID=$$!
trap "kill $$SERVER_PID $$WEB_PID" SIGINT SIGTERM
wait
else
echo -e "Starting DeerFlow in [PRODUCTION] mode...\n"
uv run server.py & SERVER_PID=$$!
cd web && pnpm start & WEB_PID=$$!
cd web && pnpm install && pnpm start & WEB_PID=$$!
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bootstrap.bat file (Windows version) was not updated with corresponding pnpm install commands. For consistency across platforms, if you're adding pnpm install to bootstrap.sh, it should also be added to bootstrap.bat. However, consider whether running pnpm install on every startup is the right approach (see performance comments on lines 9 and 15 of bootstrap.sh).

Copilot uses AI. Check for mistakes.
echo -e "Starting DeerFlow in [DEVELOPMENT] mode...\n"
uv run server.py --reload & SERVER_PID=$$!
cd web && pnpm dev & WEB_PID=$$!
cd web && pnpm install && pnpm dev & WEB_PID=$$!
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running pnpm install on every startup is inefficient and will significantly slow down the development workflow. This should only be run during initial setup or when dependencies change. Consider removing pnpm install from this startup command and only documenting it as a prerequisite step in the README or setup instructions.

Copilot uses AI. Check for mistakes.
echo -e "Starting DeerFlow in [PRODUCTION] mode...\n"
uv run server.py & SERVER_PID=$$!
cd web && pnpm start & WEB_PID=$$!
cd web && pnpm install && pnpm start & WEB_PID=$$!
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Running pnpm install on every startup is inefficient and will significantly slow down production deployment. This should only be run during the build/deployment phase, not at runtime. Consider removing pnpm install from this startup command and ensuring dependencies are installed as part of the deployment process.

Copilot uses AI. Check for mistakes.
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.

sh: dotenv: command not found

1 participant