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

Launching with "preLaunchTask" pointing to a tsc build task generate errors #8930

Closed
alvsan09 opened this issue Jan 8, 2021 · 4 comments
Closed
Assignees
Labels
bug bugs found in the application debug issues that related to debug functionality tasks issues related to the task system

Comments

@alvsan09
Copy link
Contributor

alvsan09 commented Jan 8, 2021

Bug Description:

Debug launch with automatically generated tasks and launch files for a helloworld typescript program fail with errors

Steps to Reproduce:

  1. In an empty folder Create a helloworld.ts file and corresponding tsconfig.json (see example in [3])
  2. From main menu Terminal-> Run Build Task, to configure/create a default task "tsc: bulild - tsconfig.json", the generated file under .theia/tasks.json shall look like [1].
  3. Make sure your build works by selecting Terminal -> Run build task
  4. Select your .ts file and click the main Debug icon, on the drop down menu 'No Configurations' select 'Add Configuration' and select Node.js, a new launch.json shall be created as in [2]
  5. Press the green 'Play' button to the right of the new 'Launch Program' lauch
  6. The following error appear:
    image

Additional Information

  • Operating System: linux debian
  • Theia Version: master branch, commit: 335273b

Reference project files:
[1] Generated tasks.json

{
    "tasks": [
        {
            "type": "typescript",
            "tsconfig": "tsconfig.json",
            "problemMatcher": [
                "$tsc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        }
    ]
}

[2] Generated launch.json

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  "version": "0.2.0",
  "configurations": [
    {
      "type": "node",
      "request": "launch",
      "name": "Launch Program",
      "skipFiles": [
        "<node_internals>/**"
      ],
      "program": "${file}",
      "preLaunchTask": "tsc: build - tsconfig.json",
      "outFiles": [
        "${workspaceFolder}/out/**/*.js"
      ]
    }
  ]
}

[3] Example tsconfig.json

{
    "compilerOptions": {
      "target": "es5",
      "module": "commonjs",
      "outDir": "out",
      "sourceMap": true
    }
  }
@paul-marechal paul-marechal added debug issues that related to debug functionality tasks issues related to the task system bug bugs found in the application labels Jan 8, 2021
alvsan09 added a commit to alvsan09/theia that referenced this issue Jan 14, 2021
Removing a check that seems to be a leftover from previous change [2]

[1] eclipse-theia#8930
[2] eclipse-theia#5024 (comment)

Signed-off-by: Alvaro Sanchez-Leon <[email protected]>
alvsan09 added a commit to alvsan09/theia that referenced this issue Jan 14, 2021
The issue was triggered by launching a debug session which includes a
"preLaunchTask" referencing a build task.

The issue happened even if the "cwd" option was present in the tasks.json file

The check triggering the error was removed as the 'cwd' options should not be
mandatory see 'options' under [3] as well as comment [2].

[1] eclipse-theia#8930
[2] eclipse-theia#5024 (comment)
[3] https://code.visualstudio.com/docs/editor/tasks#_custom-tasks

Signed-off-by: Alvaro Sanchez-Leon <[email protected]>
paul-marechal pushed a commit that referenced this issue Jan 18, 2021
The issue was triggered by launching a debug session which includes a
"preLaunchTask" referencing a build task.

The issue happened even if the "cwd" option was present in the tasks.json file

The check triggering the error was removed as the 'cwd' options should not be
mandatory see 'options' under [3] as well as comment [2].

[1] #8930
[2] #5024 (comment)
[3] https://code.visualstudio.com/docs/editor/tasks#_custom-tasks

Signed-off-by: Alvaro Sanchez-Leon <[email protected]>
@vince-fugnitto
Copy link
Member

Closing thanks to #8949.

@0xkiichiro
Copy link

"tsc: bulild - tsconfig.json" there is a typo. pls fix

@vince-fugnitto
Copy link
Member

"tsc: bulild - tsconfig.json" there is a typo. pls fix

@0xkiichiro can you clarify where the typo is in the code I do not see it? If you're referring to the description of the issue it is not important and quite old anyways (the issue is fixed as well).

@0xkiichiro
Copy link

under steps to reproduce 2nd step had "tsc: bulild - tsconfig.json" instead of "build".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application debug issues that related to debug functionality tasks issues related to the task system
Projects
None yet
Development

No branches or pull requests

4 participants