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.

Automatically run build_runner on VS Code startup, not working

See original GitHub issue

An issue for a problem, which came up in this issue: https://github.com/Dart-Code/Dart-Code/issues/1211#issuecomment-470621513

Here is my project: intersect.zip

@DanTup Yes, at least sort of.

I wanted to start the watch task as soon as I open VS Code. So I did the following:

  1. STRG + SHIFT + P
  2. Typed: “Tasks Configure Task” ENTER
  3. Selected, the Task I wanted to configure
  4. Modified generated task.json to the following (only added "runOptions"):

image

Now there is a warning:

Incorrect type. Expected “object”.

And when I restart Visual Studio I get an error notification and following output:

Error: The pub task detection didn’t contribute a task for the following configuration: { “type”: “pub”, “command”: “watch”, “problemMatcher”: [ “dart-pub-build_runner” ], “runOptions”: { “runOn”: “folderOpen” } } The task will be ignored.

Similar to this one: https://github.com/dart-lang/build/issues/1025#issuecomment-435993458

Any idea?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
DanTupcommented, Dec 8, 2021

I think between a fix made in https://github.com/microsoft/vscode/issues/70303 and https://github.com/microsoft/vscode/issues/126238, this should be fixable now, though requires us to adopt the new onTaskType: activation event.

1reaction
DanTupcommented, Mar 12, 2019

Ok, I’m waiting to hear back on https://github.com/Microsoft/vscode/issues/70303 before doing any more on this. In my opinion this is a bug - it should not be necessary for an extension that uses tasks to have to activate whenever the user runs any task in VS Code (especially given they don’t seem to want to give us an activation reason).

I hope we could have a more restricted activation event (eg. onTask:pub).

Read more comments on GitHub >

github_iconTop Results From Across the Web

flutter pub run build_runner build failed - dart - Stack Overflow
I tried with many solutions, But error not gone. flutter packages pub run build_runner watch command ran with endless log.
Read more >
Dart build_runner - Visual Studio Marketplace
Dart build_runner tools in VSCode. Installation. Launch VS Code Quick Open ( Ctrl+P ), paste the following command, and press enter.
Read more >
Integrating Dart's Build Runner with VSCode
What about we run build_runner build after we save a, say, Dart file? That would be conveinent and also not resource draining solution....
Read more >
VSCode Tasks and Code Generation after Save : r/FlutterDev
One strange behavior of build runner is that when it finds an already-generated file and needs to generate it again, it asks the...
Read more >
Flutter For Web: A Complete Guide to Create & Run ... - ITNEXT
Note: if you have problems configuring webdev to run directly, try: ... run your app by pressing F5 or “Debug -> Start Debugging”;...
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