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

Nested Dependent tasks are run multiple times #137698

Closed
OldStarchy opened this issue Nov 23, 2021 · 1 comment
Closed

Nested Dependent tasks are run multiple times #137698

OldStarchy opened this issue Nov 23, 2021 · 1 comment
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@OldStarchy
Copy link

OldStarchy commented Nov 23, 2021

I'd like to reopen this issue #43076 as it's basically the same thing except that my task setup is slightly different.

My abridged tasks.json

{
	"tasks": [
		{
			"label": "dev",
			"dependsOn": ["yarn watch", "yarn dev"],
			"isBackground": true
		},
		{
			"label": "yarn watch",
			"dependsOn": ["start container"],
			"isBackground": true
		},
		{
			"label": "yarn dev",
			"dependsOn": ["start container"],
			"isBackground": true
		},
		{
			"label": "start container",
		}
	]
}

Starting "dev" causes "start server" to start twice, they conflict with each other, and then both fail.

My workarounds are

  1. Remove the "dependsOn" property from "yarn dev". This way I can run "dev", wait for the watch to start, then run "dev" again. No different to manually starting the server before running "dev" though.
  2. Globally install "concurrently" and merge the two watch tasks into one.

I don't have a root-level package.json (or equivalent) for this project.

  • VS Code Version: 1.63.0-insider (user setup)
  • OS Version: Windows_NT x64 10.0.22000
@alexr00
Copy link
Member

alexr00 commented Nov 23, 2021

Same root cause as #118238, except this one has a work around:

{
	"tasks": [
		{
			"label": "_dev",
			"dependsOn": ["yarn watch", "yarn dev"],
			"isBackground": true
		},
		{
			"label": "dev",
			"dependsOn": ["start container", "_dev"],
			"dependsOrder": "sequence",
			"isBackground": true
		},
		{
			"label": "yarn watch",
			"isBackground": true
		},
		{
			"label": "yarn dev",
			"isBackground": true
		},
		{
			"label": "start container",
		}
	]
}

@alexr00 alexr00 closed this as completed Nov 23, 2021
@alexr00 alexr00 added the *duplicate Issue identified as a duplicate of another issue(s) label Nov 23, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jan 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

2 participants