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.

Debugging project in SAP Business Application Studio

See original GitHub issue

Hello,

I created an app using sap-cloud-sdk init and developed it using Visual Studio Code. During the development I debugged the app by using the JavaScript Debug Terminal available in VSCode.

I am currently exploring running the app in Business Application Studio. Running it normally in a Terminal with npm run start:dev works fine in BAS. I haven’t found a JavaScript Debug Terminal available, so I tried to configure a launch.json file.

In VSCode the following debugging configuration works perfectly, but in BAS it gets stuck in the preLaunchTask:

{
    // 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": "Debug App",
            "program": "${workspaceFolder}/src/main.ts",
            "preLaunchTask": "tsc: build - tsconfig.json",
            "outFiles": [
                "${workspaceFolder}/dist/**/*.js"
            ],
            "envFile": "${workspaceFolder}/.env",
            "console": "integratedTerminal"
        }
    ]
}

So my first question is if you recommend a different way of debugging using launch.json file? And my second one is if projects generated with sap-cloud-sdk are compatible with Business Application Studio?

If you can point me to some examples/documentation on this topic, it would be greatly appreciated also.

Thank you, Stefania

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
FrankEssenbergercommented, Feb 10, 2021

Hello @stefania-santimbrean,

I had also a quick look and since it is working in VSC it must be some difference in the BAS which is based on eclipse theia which is like the open source variant of VSC.

I found also some issue in their repo: https://github.com/eclipse-theia/theia/issues/8930 regarding the preLaunchTask. So I would try the following:

  • Make a very simple hello world app
  • Do all the prelaunch tasks manually
  • See if it starts in the BAS
  • If so try to add things like a npm build in the preLaunch and then the TS one
  • If you experience errors ask the BAS colleagues for their support.

Best Frank

P.S.: From the BAS docu the dev space should be no problem. It is even listed at Prerequisites.

1reaction
jjtang1985commented, Feb 10, 2021

Hi @stefania-santimbrean ,

I forwarded your question to my sdk colleagues. However, since this is a BAS specific question, I’m not sure whether we are able to answer.

Here is the support platform of BAS and the homepage.

Best regards, Junjie

Read more comments on GitHub >

github_iconTop Results From Across the Web

Debug Your SAPUI5 App with SAP Business Application Studio
Debug Your SAPUI5 App with SAP Business Application Studio · Step 2. Change the log level. Add the following line to the webapp/index....
Read more >
SAP Business Application Studio - Debugging
To debug a node.js file: Open the Run and Debug view. Run and Debug View. Open the dropdown list to select the relevant...
Read more >
SAP Business Application Studio CAP project (node.js) debug ...
Debugger does not get auto-attach to the running node server, so I am not able to stop at the breakpoint set in server.js...
Read more >
SAP® BAS(Business Application Studio) in a Nutshell - Medium
When you want to debug, a breakpoint within the code can be easily set by clicking before the line number of the code....
Read more >
Choose Your Preferred Tools - SAP Capire
Install Visual Studio Code; Add CDS Editor; Run Services; Debug Services; Restart the Server; Run a CAP VS Code Notebook ... SAP Business...
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