Skip to content

VSCODE_ENV_REPLACE setting NODE_ENV=production unexpectedly #3302

@alex-oleksenko

Description

@alex-oleksenko

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 to production 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

  1. Setup: Open a development project in Cursor
  2. Check Environment: Verify that NODE_ENV should be development or not set
  3. Start Development Process: Run any development command or process
  4. Observe Issue: Notice that NODE_ENV is unexpectedly set to production

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 via VSCODE_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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions