Skip to content

VSCODE_ENV_REPLACE injecting old prod .env into nodeΒ #25223

@Pankkss

Description

@Pankkss

Type: Bug

Behaviour

ms-python extension is injecting old prod env vars into node dev server via VSCODE_ENV_REPLACE. This is overriding the dev config in nextjs web app.

Steps to reproduce:

  1. Start nextjs dev server with pnpm run dev
  2. Print env:
  • console.log('NODE_ENV', process.env.NODE_ENV) - returns correct NODE_ENV: 'development'
  • console.log('process.env', process.env) - returns correct dev env config, but VSCODE_ENV_REPLACE contains old prod config which is overriding everything else
  1. Applications exhibits prod behavior
  2. Disable ms-python extension
  3. Restart cursor IDE
  4. Run pnpm run dev in new terminal instance
  5. Print env:
  • console.log('process.env', process.env) - returns correct dev .env config and VSCODE_ENV_REPLACE is abscent.
  1. Application exhibits dev behavior
  2. Re-enable ms-python extension without restarting terminal
  3. Observed old env vars trying to be injected when viewing "Show environment contributions" tab. (env vars haven't been included for obvious reasons):
Image

Image


Extension version: 2025.6.1
VS Code version: Cursor 1.1.6 (5b19bac7a947f54e4caa3eb7e4c5fbf832389850, 2025-06-25T02:14:24.784Z)
OS version: Darwin arm64 24.5.0
Modes:

-   Python version (& distribution if applicable, e.g. Anaconda): 3.12.9
-   Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Pyenv
-   Value of the `python.languageServer` setting: Pylance

<details>
<summary>User Settings</summary>
<p>

languageServer: "Pylance"

</p>
</details>

<details>
<summary>Installed Extensions</summary>

|Extension Name|Extension Id|Version|
|---|---|---|
|cursor-always-local|any|0.0.1|
|cursor-deeplink|any|0.0.1|
|cursor-retrieval|any|0.0.1|
|cursor-shadow-workspace|any|1.0.0|
|cursor-themes|und|0.0.2|
|cursor-tokenize|any|0.0.1|
|debugpy|ms-|2025.6.0|
|intellij-idea-keybindings|k--|1.7.4|
|js-debug|ms-|1.93.0|
|js-debug-companion|ms-|1.1.3|
|jupyter-keymap|ms-|1.0.0|
|markdown-all-in-one|yzh|3.6.3|
|markdown-preview-enhanced|shd|0.8.18|
|playwright|ms-|1.1.15|
|python|ms-|2025.6.1|
|rest-client|hum|0.26.0|
|terraform|has|2.34.5|
|vscode-django|bat|1.15.0|
|vscode-dotnet-runtime|ms-|2.3.2|
|vscode-github-actions|git|0.27.2|
|vscode-jest|Ort|6.4.3|
|vscode-jest-runner|fir|0.4.82|
|vscode-js-profile-table|ms-|1.0.9|
|vscode-pylance|ms-|2024.8.1|
|vscode-stripe|str|3.8.6|
</details>
<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Apple M1 Pro (10 x 2400)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: enabled_on<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_graphite: disabled_off<br>video_decode: enabled<br>video_encode: enabled<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled<br>webnn: disabled_off|
|Load (avg)|3, 3, 4|
|Memory (System)|16.00GB (0.07GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|
</details>
<!-- generated by issue reporter -->

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions