Skip to content

How to disable VSCode launch.json prioritize build folder using ${file}? #279293

@eliezra236

Description

@eliezra236

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

  • VS Code Version: 1.105.1
  • OS Version: MacOS 26.0.1

Steps to Reproduce:

I have the following configuration in my launch.json file

        {
            "type": "node",
            "request": "launch",
            "name": "Server - Current File",
            "program": "${file}",
            "cwd": "${workspaceFolder}/server",
            "runtimeExecutable": "tsx",
            "outputCapture": "std",
            "env": {
                "NODE_ENV": "development"
            }
        },

I am using it to run files from my src folder using tsx without running a full build.
The problem is if a build folder exist it will run the file from the build folder instead of running the src folder version.

└── server/
    ├── src/
    │   └── file.ts
    └── build/
        └── file.js

If my open file is the src/file.ts, running the following launch.json config will run the build/file.js instead. But if I delete the build folder from the system, then it will run the src/file.ts correctly.
I have tried to switch to "program": "${workspaceFolder}/${relativeFile}", but it still do the same process.

I've open a stack overflow issue about it, but there were no working solutions.
https://stackoverflow.com/questions/79815485/how-to-disable-vscode-launch-json-prioritize-build-folder/79817215

Metadata

Metadata

Assignees

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