Skip to content

NodeJS Environment Variables within launch.json are undefined if they contain the _ (underscore) character #45423

@BenLBartle

Description

@BenLBartle

Issue Type

Bug

Description

Reproduceton Steps:

Create a NodeJS application, and add the required configuration to the the launch.json file:

"type": "node",
           "request": "launch",
           "name": "<Name>",
           "program": "${workspaceFolder}/<folder>/app.js",
           "env": {
               "INVALID_VALUE": "C:\\Temp\\file.zip",
               "VALIDVALUE": "C:\\Temp\\file.zip"
           }

When debugging, "proces.env["INVALID_VALUE"] is always undefined. However process.env["VALIDVALUE"] always returns a value (even if the two variables have the same defined value as per the example above. Not a problem if you are in control of the environment variable names, but in the vsts-task-lib always expects input values to be prefixed "INPUT_".

When running the application outside the debugger, and setting the environment variables via the console, they are defined as expected.

VS Code Info

VS Code version: Code 1.20.1 (f88bbf9, 2018-02-13T15:34:36.336Z)
OS version: Windows_NT x64 10.0.16299

System Info
Item Value
CPUs Intel(R) Core(TM) i5-5300U CPU @ 2.30GHz (4 x 2295)
Memory (System) 7.88GB (1.34GB free)
Process Argv C:\Program Files\Microsoft VS Code\Code.exe
Screen Reader no
VM 0%
Extensions (7)
Extension Author (truncated) Version
vscode-eslint dba 1.4.7
tslint eg2 1.0.28
Angular-BeastCode Mik 5.2.16
csharp ms- 1.14.0
vs-keybindings ms- 0.2.0
azurerm-vscode-tools msa 0.4.0
vscode-docker Pet 0.0.25

Metadata

Metadata

Assignees

Labels

*not-reproducibleIssue cannot be reproduced by VS Code Team member as describeddebugDebug viewlet, configurations, breakpoints, adapter issues

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions