Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI DEBUG NodeJS: environment variables added in the .env file are concatenated during debugging (since 1. #193551

Closed
karim73 opened this issue Sep 20, 2023 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues info-needed Issue requires more information from poster verified Verification succeeded
Milestone

Comments

@karim73
Copy link

karim73 commented Sep 20, 2023

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.82.2, 1.82.1, 1.82.0
  • OS Version: win 10
  • language: nodejs
  • it worked perfectly before the last updates
  • works fine under 1.81.1 and below

Steps to Reproduce:

  1. create a nodejs project
  2. add .launch configuration
    {
    "name": "Node: test:debug",
    "port": 9229,
    "request": "attach",
    "skipFiles": ["<node_internals>/**"],
    "type": "node",
    "envFile": "${workspaceFolder}/.env"
    },
  3. add .env file: with some variables in .env and .bash_profile
    FOO_BAR=fooBar
  4. start debug, with cli
    node_modules/env-cmd/bin/env-cmd.js node_modules/mocha/bin/mocha.js -c --exit --recursive test/foobar.spec.js --inspect-brk=localhost:9229
  5. and inspect process.env.FOO_BAR
    expect: process.env.FOO_BAR=fooBar
    actual: process.env.FOO_BAR=fooBarfooBar

But It works fine when I run debuging from vscode, since env variables will be read from bash_profile

@karim73
Copy link
Author

karim73 commented Sep 20, 2023

It works (v 1.82.2) when I remove "envFile": "${workspaceFolder}/.env"
The env variables will be picked from bash_profile and will ,not be concatenated

Is there any bug ?

@lelle741122
Copy link

Kk

@lelle741122
Copy link

#193551 (comment)

@roblourens roblourens assigned connor4312 and unassigned roblourens Sep 20, 2023
@connor4312 connor4312 added bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues labels Sep 21, 2023
@connor4312
Copy link
Member

Fixed in microsoft/vscode-js-debug#1832

@connor4312 connor4312 added this to the October 2023 milestone Oct 6, 2023
@DonJayamanne
Copy link
Contributor

@connor4312
I have the followin version of ms-vscode.js-debug-nightly 2023.10.2317
Last updated => 2023-10-24, 13:36:13
Identifier => ms-vscode.js-debug-nightly

Version: 1.84.0-insider
Commit: 7dff078
Date: 2023-10-24T05:44:16.118Z
Electron: 25.9.2
ElectronBuildId: 24603566
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 23.0.0

However I can still see actual: process.env.FOO_BAR=fooBarfooBar

@DonJayamanne DonJayamanne reopened this Oct 25, 2023
@DonJayamanne DonJayamanne added the verification-found Issue verification failed label Oct 25, 2023
@connor4312
Copy link
Member

I'm not able to reproduce that @DonJayamanne. Can you please collect a log file?

/jsDebugLogs

@connor4312 connor4312 removed the verification-found Issue verification failed label Oct 25, 2023
@VSCodeTriageBot
Copy link
Collaborator

Please collect trace logs using the following instructions:

If you're able to, add "trace": true to your launch.json and reproduce the issue. The location of the log file on your disk will be written to the Debug Console. Share that with us.

⚠️ This log file will not contain source code, but will contain file paths. You can drop it into https://microsoft.github.io/vscode-pwa-analyzer/index.html to see what it contains. If you'd rather not share the log publicly, you can email it to connor@xbox.com

@VSCodeTriageBot VSCodeTriageBot added the info-needed Issue requires more information from poster label Oct 25, 2023
@DonJayamanne
Copy link
Contributor

@connor4312
Copy link
Member

It appears you are still using js-debug stable. Please follow the steps here to enable the nightly extension: https://github.com/microsoft/vscode-js-debug#nightly-extension The version will also be bumped in tomorrow's Insiders

Closing for verification.

@DonJayamanne DonJayamanne added the verified Verification succeeded label Oct 25, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues info-needed Issue requires more information from poster verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants