-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Bug Summary
Cursor's internal VSCODE_ENV_REPLACE
environment variable is inappropriately setting NODE_ENV=production
, which can interfere with development workflows and cause unexpected behavior in development environments.
Issue Details
Problem Description
When working in development environments, Cursor's VSCODE_ENV_REPLACE
environment variable forces NODE_ENV=production
, overriding the expected development environment settings and potentially causing various development issues.
Root Cause
The VSCODE_ENV_REPLACE
variable contains extension-specific environment variables (primarily for the Redis extension) but also includes NODE_ENV=production
, which overrides the expected development environment settings.
Impact
- Environment Variable Override:
NODE_ENV
is forced toproduction
regardless of project configuration - Development Workflow Disruption: Applications may behave differently than expected in development
- Configuration Conflicts: Development-specific settings may not work as intended
- No User Control: No way to configure or disable this behavior
- Extension Environment Pollution: Extension environment variables leak into development workflow
Steps to Reproduce
- Setup: Open a development project in Cursor
- Check Environment: Verify that
NODE_ENV
should bedevelopment
or not set - Start Development Process: Run any development command or process
- Observe Issue: Notice that
NODE_ENV
is unexpectedly set toproduction
Expected vs Actual Behavior
Expected Behavior
NODE_ENV
should be controlled by the project configuration- Development environments should use
NODE_ENV=development
or project-specific values - Extension environment variables should not interfere with development workflow
- Users should have control over environment variable settings
Actual Behavior
- Cursor forces
NODE_ENV=production
viaVSCODE_ENV_REPLACE
- Development processes may behave as if in production mode
- No way to disable or configure this behavior
- Extension environment variables pollute the development environment
Environment Information
- Cursor Version: 1.1.6
- Operating System: macOS 24.5.0 (darwin)
- Node.js Version: v22.15.1
Workarounds
Temporary Workarounds
Explicit NODE_ENV Setting: Set NODE_ENV=development
explicitly in shell before running commands