question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I debug the project in Visual Studio Code?

See original GitHub issue

I’d like to be able to contribute to the project. In order to do that efficiently, I’d like to run the Amplify CLI in Visual Studio Code and debug the code by setting breakpoints. How does one do that?

At first, I just forked/cloned to build the project and do a basic run of the project from source. I tried to start with the suggested steps to build the project from the Contributing section of the README. However, these steps fail (see attached errors):

$ npm run setup-dev
yarn config set workspaces-experimental true

Amplify CLI npm run setup-dev errors.txt

I noticed that there is this note in the GraphQL transformer docs: “there are some debug configurations defined in .vscode/launch.json you can use Visual Studio code to add debug breakpoints to debug the code.” However, there is no launch.json file as noted.

At a bare minimum, it would be good to be able to build and run the project from source. And ideally, if there were a launch.json file to run in Visual Studio Code, that would be even better. How does the Amplify team debug the project? (It would be tough to imagine one could not debug the code and set breakpoints.)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
haverchuckcommented, Mar 14, 2019

@chrisl777 @kstro21

If you want to debug in vs code, you can add the following configuration to your launch.json:

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [

    {
      "type": "node",
      "request": "launch",
      "name": "types gen simple type",
      "program": "${workspaceFolder}/packages/amplify-cli/bin/amplify", // path to your instance of the CLI, after you've run the npm run setup-dev command
      "cwd": "/absolute/path/to/amplify/project",
      "args": [
        // the cli commands that you will be testing, below is an example for 'amplify auth add;
        "auth",
        "add"
      ],
      "console": "integratedTerminal", 
    },
  ]
}
0reactions
github-actions[bot]commented, May 27, 2021

This issue has been automatically locked since there hasn’t been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introduction to Debugging in Visual Studio Code
Debugging is a core feature of Visual Studio Code. In this tutorial, we will show you how to run and debug a program...
Read more >
Run and Debug Java in Visual Studio Code
Another way to start debugging is to select Run Java or Debug Java menu from the top editor title bar. EditorMenu. Run from...
Read more >
Debugger Extension - Visual Studio Code
In your VS Code vscode-mock-debug project select the launch configuration Server from the dropdown menu and press the green start button.
Read more >
Debug a .NET console application using Visual Studio Code
Open the Debug view by selecting the Debugging icon on the left side menu. ... Select the green arrow at the top of...
Read more >
Tutorial: Debug C# code - Visual Studio (Windows)
To start debugging, select F5, or choose the Debug Target button in the Standard toolbar, or choose the Start Debugging button in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found