The launch.json configuration in vscode does not support the use of the property args

I'm currently editing my launch.json file in vscode to make some basic configurations, but I keep encountering an error that says Property args is not allowed. Here is the configuration I have:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "attach",
            "name": "index",         
            "args": [
                "src/index.ts"
            ],
            "cwd": "${workspaceFolder}"           
        }
    ],
    "compounds": []
}

https://i.sstatic.net/b3Kw2.jpg

Answer №1

It turned out to be a simple oversight on my part. After referring to this documentation, I realized my mistake.

The VS Code debuggers are designed to either launch a program in debug mode or attach to an already running program in debug mode. Depending on the chosen action (attach or launch), specific attributes are required, and the validation features of VS Code's launch.json provide assistance in configuring these parameters correctly.

Upon switching my request from attach to launch, everything fell into place. It became apparent that only the request type launch allows for the configuration of args.

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "index",         
            "args": [
                "src/index.ts"
            ],
            "cwd": "${workspaceFolder}"           
        }
    ],
    "compounds": []
}

Answer №2

Trying to pass command line arguments to a remote [ssh] debug is causing an issue where I keep receiving the error "Property args is not allowed". However, when I switch the request to 'launch', the error then shifts to "Property connect is not allowed". :(
It appears that starting the debug does work and attach, but my arguments are not being included.

{
    // Utilize IntelliSense for possible attributes.
    // Hover over attributes for descriptions.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Remote Attach",
            "type": "python",
            "request": "launch",
            "connect": {
                "host": "gmc0410",
                "port": 5678
            },
            "pathMappings": [
                {
                    "localRoot": "${workspaceFolder}",
                    "remoteRoot": "."
                }
            ],
            "justMyCode": true,
            "args": ["AuditNP", "arg2"]
        }
    ]
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilize serde_json to extract key information from a JSON dataset and display all the keys in the

Here is a basic example showcasing how to parse JSON data in Rust. After parsing, the question arises on how to identify the keys of a serde_json::Value, such as "name", "age", "phones" in this particular scenario? fn json_h ...

Synchronize local JSON file with remote JSON file

Looking for a way to automatically update my local JSON file in the application whenever a new version is released. I already have an algorithm that detects if a new version is available or not. Now, I need assistance with coding to synchronize and update ...

Developing a separate NPM package for a portion of the app causes an increase in the total app size

Our projects utilize create-react-app and Typescript, resulting in the emergence of a collection of commonly used React components. To enhance maintenance and reusability, we decided to extract these components into their own NPM package named PackageA. Su ...

Unable to unmarshal the object in JSON-RPC

Currently, I am delving into understanding how JSON-RPC operates and decided to test it out in Go language (golang). The Go program seems to be functioning perfectly fine as intended. However, when attempting to make a raw request via telnet, an error aris ...

Ways to expose a declared module in Enzyme's shallow rendering?

I've been grappling with how to ensure that my custom declared module is detected when I shallow render a component using enzyme in Jest unit tests. The issue revolves around a specific module declaration named _aphrodite, which looks like this: // i ...

Issue encountered when working with Next Auth and TypeScript: The argument type 'string | undefined' cannot be assigned to the parameter type 'string | Buffer'

Encountering a TypeScript error that states: "Argument of type 'string | undefined' is not assignable to parameter of type 'string | Buffer'." An attempt to integrate NextAuth into a Next.js 14 application and configure logi ...

Populate a JSON table in React with checkboxes and automatically mark them based on the JSON data

I'm currently working on creating a React table using JSON data like this: [ { "Id_side": 123, "Name_side": "R4", "Name_cycle": "C1" }, { "Id_side": 345, "Name_side": "M1", "Name_cycle": "C2" ...

When attempting to store retrieved JSON dictionaries in an array, it is resulting in a nil

I have a database containing various files with attributes like URL, title, and timestamp. Whenever I load a specific view controller, I retrieve the file data and display it in a table view. Because there are multiple files each having their own set of at ...

Using Javascript in n8n to merge two JSON arrays into a single data structure

When working on a project, I extract JSON objects from the Zammad-API. One of the tickets retrieved is as follows: [ { "id": 53, "group_id": 2, "priority_id": 2, "state_id": 2, "organizati ...

Interacting with RESTful web services using jQuery

I'm working on a web service that provides data in JSON format through a specific URL. My current challenge involves figuring out how to store this data in a variable using jQuery. Here's what I've attempted so far: $.ajax( { type:'G ...

Working with JSON data in Typescript without specified keys

My goal is to extract the IssueId from the JSON data provided below: [ { "-MERcLq7nCj5c5gwpYih": {"CreateDate":"2020-08-11T08:27:13.300Z","Id":"-MERcLq7nCj5c5gwpYih","IssueId":"-ME3-t ...

getStaticProps will not return any data

I'm experiencing an issue with my getStaticProps where only one of the two db queries is returning correct data while the other returns null. What could be causing this problem? const Dash = (props) => { const config = props.config; useEffect(() ...

Hold off for the JSON parsing process to occur in a separate class file within a Swift 3 environment

In the code snippet below, I have created a class where I am parsing a JSON file outside the viewController. Initially, when I create an AllCards object in the view controller, it returns 0. However, after some time, it returns the correct number of cards ...

Storing JSON data in a database and then parsing it at a later time

{"meta":{"code":200},"response":{"groups":[{"type":"places","name":"Matching Places","items":[{"id":"4c76542e6f789c7467ec514c","name":"India Gate","contact":{},"location":{"address":"New Delhi, India","crossStreet":"None","city":"Delhi","state":"Delhi","po ...

Distinguish individual elements within JSON from each other

Despite my limitations in altering the server-side code that generates this JSON: [ { test_id: "1", test_name: "Diagnostic Test 1" }, { test_id: "2", test_name: "Test 1" }, { test_id: "3", test_name: "Test 2" } ] I am ...

Python ValueError: Unable to decode JSON as a valid object despite the JSON being correctly formatted

My JSON file was valid (verified using this website) but suddenly it cannot be read. This script has been functional for a long time. I'm unsure what caused the issue. Here is the script: import os import json basepath = '/path/' for entr ...

Issue Report: Angular 2 version 2.0.0-rc.1 error - Missing 'map' property on type 'Observable<Response>' differs from previous reports

It seems like I am encountering a similar issue as mentioned in Angular 2 beta.17: Property 'map' does not exist on type 'Observable<Response>' However, the solutions provided for the beta version do not seem to work for the latest r ...

Encountering a SyntaxError with the message 'Unexpected token' while trying to require a module in strict mode from JSON at position 0

Within the index.js file, the following code is present: 'use strict'; const config = require('./config'); In the config.js file, the code looks like this: 'use strict'; const config = new function() { this.port = 3000; ...

Troubleshooting problem with Angular Click Outside Directive and unexpected extra click event issue

The challenge I'm facing involves implementing a custom Click Outside Directive for closing modal dialogs, notifications, popovers, and other 'popups' triggered by various actions. One specific issue is that when using the directive with pop ...

What is the best way to confirm if a Json response is empty or not?

{"PatientPastMedicalHistoryGetResult":{"PastMedicalHistory":[]}} The PastMedicalHistory object does not contain any values. How can I verify if it is empty? ...